Reputation: 1083
Is there any method to monitor the change event of window.selection?
Something like a callback, to be invoked when user select different content.
Upvotes: 3
Views: 1598
Reputation: 22847
If you're using jQuery, and you want to handle select on a specific item with an ID of myInput
, you can do this:
$("#myInput").select(function() { alert("Something was selected!"); });
Otherwise, I think you'd need to add it in HTML, like this:
<input type="text" onSelect="alert('foo');" value="default text">
Upvotes: 2