What I’m trying to do is: when you mouse over any word in a body of text say for two seconds, it will become underlined. And if you click it, it will stay underlined until you click anywhere else or you click it one more time. Any suggestions?
Share
There is no built in event so you would have to split the text and wrap each word in an element. It can become very slow with large amounts of text.
See How can I highlight every single word in jquery so that I can provide a definition for each word?
Have a look at this sample – http://jsbin.com/ukuza5/3/edit
Will only work with plain text – no html inside p.