Tell if a user has selected text on my page - Javascript jQuery

Javascript examples for jQuery:Selector

Description

Tell if a user has selected text on my page

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.5.2.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*from www. j ava  2 s  . c  om*/
$('#target').dblclick(function() {
  console.log('Handler for .dblclick() called.');
});
    });

      </script> 
   </head> 
   <body> 
      <div id="target">
          Double-click here 
      </div>  
   </body>
</html>

Related Tutorials