I have connected sortable list and I want to have a callback function for double click on the list elements. Is there a standard way to figure out what is the html/text content of the item that was clicked? I am doing the following on chrome but it does not work on Firefox.
//when element is dropped in connected sortable
ui.item[0].ondblclick = wordClicked;
function wordClicked(e) {
console.log(e.srcElement.innerText);
}
I would use jQuery methods as jQuery is built to work on all browsers.
For your double click event handler you can use this http://api.jquery.com/dblclick/
And to get the text of an element you can use this http://api.jquery.com/text/
I’ve created this jsFiddle that shows how both methods work http://jsfiddle.net/davew9999/7cQXX/
HTML
JavaScript