I have an HTML element with only visible text inside. This example is a <div> element, but it could be a <span>, <p>, or other DOM element. <div>This is a simple example.</div> When clicked, I can get the position of the cursor on the surface of the div, but I need to determine the position of the nearest character and/or its index into the div.innerHTML string at the time of the click. I found a
