I try to display alert when click on row
i try this
- <table cellspacing="0"
- rules="all"
- border="1"
- id="tabledata"
- style="border-collapse:collapse;">
- <tr>
- <th>ID</th>
- <th>Name</th>
- <th>DOB</th>
- <th>Email</th>
- </tr>
- <tr>
- <td>237</td>
- <td>John</td>
- <td>05/04/1981</td>
- <td>[email protected]</td>
- </tr>
- <tr>
- <td>238</td>
- <td>Tom</td>
- <td>11/11/1967</td>
- <td>[email protected]</td>
- </tr>
- </table>
-
but when i try this nothing happens check js fiddle
https://jsfiddle.net/jjhby695/19/
- $("tabledata tr").click(function () {
- alert('unitNo');
- });