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

linked list

A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers . This elements can be accessed by pointer traversing.

1 year ago By Aniket Prajapati
Prim's Algorithm

Prim's Algorithm is a graph algorithm and this algorithm works as it starts with a single node and then moves through several adjacent nodes form that node , in order to explore all of the connected edges along the way.

1 year ago By Aniket Prajapati
Searching Algorithm.

Linear Search Algorithm in the Array traverse through each element in the give array and search the elements.

1 year ago By Aniket Prajapati
10 common JavaScript interview questions that you might encounter !!!

In this article, we will discuss 10 JS questions that are commonly asked in interviews. These questions cover a range of JavaScript topics and are commonly asked in interviews to assess a candidate's understanding of the language. Make sure to practice and understand these concepts to perform well in JavaScript interviews.

1 year ago By Mitali Gupta