Posted By

jrobinsonc on 01/13/10


Tagged

input jquery text


Versions (?)

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


 / Published in: JavaScript
 

  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  

You need to login to post a comment.