Jquery has a way to manipulate the first td? of each tr

encounter a situation where you need to operate the first td, of each tr in table to do the click event
html like this

<table class="datagrid-body">
  <tr>
    <td>Jill</td>
    <td>Smith</td> 
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td> 
    <td>94</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td> 
    <td>94</td>
  </tr>
</table>

I currently write jquery like this, but only the td of the first tr has the click effect.
how can I make the first td of every tr eat this click effect?

$(document).on("click", ".datagrid-body tr td:first", function (e){
    alert("test")
}});

Mar.29,2021

: firstchild


get all tr, recycling binding events


td:nth-child (1)

try the nth-child () selector


you can read this article. Getting the first td, in each tr in the table is very simple:
two ways for jquery to get the first td cell in all the tr rows of the table

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38308-2c0fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38308-2c0fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?