Reputation: 2670
How could I detect in JavaScript in the Android Browser the event when the user selects or changes the selection of some text and elements in the HTML page using JavaScript? Android browser won't dispatch touch end is such situation? Any ideas besides establishing a timer?
Upvotes: 2
Views: 262
Reputation: 324647
Recent WebKit has the selectionchange
event on document
. I've no idea if your Android's browser is recent enough, but you could give it a try.
document.addEventListener("selectionchange", function() {
alert("Selection changed");
}, false);
Upvotes: 3