I have some text inside a < p > element, and need to find the word that was double tapped.
I am using a double tap jquery plugin (https://gist.github.com/attenzione/7098476) which works great on detecting the event, but I don't know how to get the word that is under it.
How can I get it?
Added what I have so far:
$("p").on('doubletap',function(event){
alert ("double tap"); // event is working
var sel = (document.selection && document.selection.createRange().text) || (window.getSelection && window.getSelection().toString());
alert ("sel "+sel); //<-- not working
});