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

Introduction to Django

A high-level Python web framework called Django makes it possible for programmers to create web applications rapidly and effectively. It adheres to the Model-View-Controller (MVC) architectural design pattern, placing emphasis on the division of duties and encouraging code reuse. Django offers a comprehensive collection of conventions, frameworks, and tools that speed up development and promote best practises.

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
How to use and upload profile photos to AWS s3 using laravel jetstream

Using jetsream to upload photos to s3 configuration and details

1 year ago By Santosh Kshirsagar
Binary Search top interview questrions.

As we know binary search itself is a imp topic to be learned in Data Structures and Algorithm so, This article contains all the important questions that can be asked in coding interview or online assessment(OA) . Here the questions clear all the concepts and the variety in questions helps to understands the logic behind the concepts .

1 year ago By Aniket Prajapati