On the html page, you may have code with two paragraphs, for example:
<hr /> <p>The first paragraph</p> <p>The second paragraph</p> <hr />
and very simple, these two tags will look like this:
First paragraph
Second paragraph
I am interested in letting the user click somewhere in the displayed HTML to insert a new element using jQuery. For example, if I click between the letter I and the letter r (just click, without highlighting / selection) in the word f * ir * st found in the first paragraph, I could insert a custom span element or whatever as in this place in the HTML code, which leads to something like this:
<hr /> <p>The fi<span id="myCustomSpan"></span>rst paragraph</p> <p>The second paragraph</p> <hr />
Any ideas that might help me? My request excludes absolute positioning. This will not solve my problems.
prince
source share