Limited Period Offer : 20% Discount on online/offline courses, for more details call/whatsapp

Livewire contenteditable to variable using entagle

0 min read
1 year ago By Santosh Kshirsagar

<style>
    [contenteditable] {
    outline: 1px solid silver;
    padding: 4px;
    }
    </style>
    <div x-data="{ content: @entangle('description') }">
        <div x-on:blur="content = $event.target.innerHTML" contenteditable onmouseup="mouseUp()" class="focus:border-0">{!! $description !!}</div>
    </div>
    <script>
        function mouseUp()
        {
            if(window.getSelection().focusOffset != window.getSelection().anchorOffset){
                alert(window.getSelection().anchorNode.data);
                //alert(window.getSelection().anchorNode.data.substring( window.getSelection().anchorOffset,window.getSelection().extentOffset ));
            }
        }
    </script>
Aug 25, 2023 12:25 Back to Articles

Other Articles

What is Agile Development ? What is Agile Development ?

Agile development is a software development approach that emphasizes flexibility, collaboration, and continuous delivery. It involves iterative development, continuous feedback, a collaborative approach, adaptability, and continuous improvement.

1 year ago By Mitali Gupta
Binary Tree

Binary Tree is a Non-Linear data structure which has atmost 2 child . A Binary tree is represented by a pointer to the topmost node (commonly known as the “root”) of the tree. If the tree is empty, then the value of the root is NULL. Each node of a Binary Tree contains the following parts:

1 year ago By Aniket Prajapati
How to identify Stack Questions? How to identify Stack Questions?

In this article, you will get clarity about how to find any given question that can be solved using stack.

1 year ago By Aniket Prajapati
EdKool.com Launches: A New Destination for All Things Education & Technology

We're delighted to announce the launch of EdKool.com, a unique platform designed to bridge the gap between education and technology.

1 year ago By Santosh Kshirsagar