JSFiddle - React, Tailwind, and code Playground

by VivekVish

HTML

<html>
    <head>
    </head>
    <body>
        <p>Hello</p>
    </body>
</html>

JavaScript

$(document).ready(function()
{
    $('p').attr('contenteditable',true);
    var sel = window.getSelection();
    var range = document.createRange();
    range.selectNodeContents($('p')[0]);
    sel.removeAllRanges();
    sel.addRange(range);
});