JQuery を使用して、ユーザーがリンクまたは 3 番目の列をクリックしたかどうかを知る必要があり、最初の列の変数の値を取得する必要があります。どうすればいいですか?
私のHTML:
<div id="test">
<table id="tablex" cellpadding="0" cellspacing="0" border="0" class="display">
<thead>
<tr>
<th>Cod</th>
<th>Name completo</th>
<th> </th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>John Foster 1</td>
<td><img entity_id="1" class="image-selector" src='imagens/grid_cancel.png' title='' /></td>
</tr>
</tbody>
</table>
私のjQuery:
$("#tablex tbody").on("click", "td", function(event){
alert($(this).text());
});