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

Quill Editor in laravel livewire

using quill editor in livewire code

1 year ago By Santosh Kshirsagar
HashMaps

Hashing is a technique or process of mapping keys, and values into the hash table by using a hash function. It is done for faster access to elements.

1 year ago By Aniket Prajapati
Merge Two Sorted Linked List

Merge Two Sorted Linked List is a Standard Linked list Problem which is Frequently asked in Many Coding interviews. The basic idea is you have given Two Sorted Linked list which are sorted in its own and you have to return return a pointer node which has a merge single list of both the sorted list .

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