Javascript examples for jQuery:Selector
Popup on table row text highlight/selection
<html lang="en"> <body> <table> <tbody> <tr> <td>SOME TEXT</td> </tr> // w ww . j a v a 2s . co m </tbody> </table> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> $('table').on('mouseup', function(){ var selectedText = window.getSelection().toString(); if (selectedText) { console.log('Some text was selected'); } }) </script> </body> </html>