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

How to connect aws RDS instance using mysql workbench

Learn to connect RDS instance(mysql/mariadb) using mysql workbech.

1 year ago By Santosh Kshirsagar
For Laravel Setting UP CI/CD Pipeline using GitHub, CodeDeploy, S3 and EC2

Setting ci/cd pipeline for laravel application on aws using github actions then uploading to s3 and using codedeploy application gets installled on EC2 instance

1 year ago By Santosh Kshirsagar
Real DOM VS Virtual DOM

In this article, we will discuss the differences between the real DOM and the virtual DOM in the context of web development. We'll explore how these concepts impact the performance and efficiency of web applications, and how they contribute to the overall user experience. By the end of this article, you'll have a clear understanding of the distinctions between these two approaches to managing and updating user interfaces on the web.

1 year ago By Mitali Gupta
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