scropio gurl

scropio gurl

  • 2k
  • 147
  • 90.7k

onclick on tr row

Jul 20 2016 4:13 AM
I try to display alert when click on row 
i try this
  1. <table cellspacing="0"   
  2. rules="all"   
  3. border="1"   
  4. id="tabledata"   
  5. style="border-collapse:collapse;">  
  6. <tr>  
  7. <th>ID</th>  
  8. <th>Name</th>  
  9. <th>DOB</th>  
  10. <th>Email</th>  
  11. </tr>  
  12. <tr>                            
  13.  <td>237</td>  
  14. <td>John</td>  
  15. <td>05/04/1981</td>  
  16. <td>john@abcsoftware.com</td>  
  17. </tr>  
  18. <tr>          
  19. <td>238</td>  
  20. <td>Tom</td>  
  21. <td>11/11/1967</td>  
  22. <td>tom@abcsoftware.com</td>  
  23. </tr>  
  24. </table>   
  25.     
 but when i try this nothing happens check js fiddle
 
https://jsfiddle.net/jjhby695/19/

  1. $("tabledata tr").click(function () {  
  2. alert('unitNo');  
  3. });  

Answers (4)