JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
</head>
<body>
<div id="content">
<p>Hello</p>
</div>
<div id="clickThis" class="clickThis">
<p>If you click on this or anywhere for that matter after focusing on Hello, you lose your focus on Hello</p>
</div>
</body>
<html>
JavaScript
$(document).ready(function()
{
$('#content')[0].contentEditable=true;
document.getElementsByClassName('clickThis')[0].addEventListener('mousedown',function(e)
//document.getElementById('clickThis').addEventListener('mousedown',function(e)
// document.addEventListener('mousedown',function(e)
{
console.log(window.getSelection().getRangeAt(0).startContainer);
e.preventDefault();
});
/* }); */
/* $('#clickThis').bind('mousedown',function(e)
{
console.log(window.getSelection().getRangeAt(0).startContainer);
e.preventDefault();
}); */
});