Javascript examples for jQuery Method and Property:index
Jquery clone event handling
<html lang="en"> <head> <style> table tbody tr { background-color: LightGrey; } p.hi {//from ww w . ja v a2 s . c o m color: lightgrey !important; } p { color: red; } </style> </head> <body translate="no"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> $( "table#hi tbody tr" ).click(function() { var index = $( "table#hi tbody tr" ).index( this ); console.log(index); }); </script> </body> </html>