Remover un texto seleccionado luego de hacer doble clic con el mouse


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function clearSelection() {
  2. if(document.selection && document.selection.empty) {
  3. document.selection.empty();
  4. } else if(window.getSelection) {
  5. var sel = window.getSelection();
  6. sel.removeAllRanges();
  7. }
  8. }
  9. $(element).bind('dblclick',function(event){
  10. //hacer algo
  11. clearSelection();
  12. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.