In an HTML document, how do I get a word with a single click?
For instance if I have this:
<div id = "word">
hello world
</div>
I’d like to be able to click any word within the word div and get it without selection. Would this be possible using JQuery, perhaps?
You want to say clicking on a word in a block of text alerts you that specific word?? If yes then here is the
js fiddlefor you:and here is a similar
Stackoverflowquestion which may help you alot:Detect which word has been clicked on within a text
Hope this helps.