get the value from a particular column
I'm trying to alert message on click each column. I have a table in which
three row and four column, now i want alert message with next column value
on third column click of each table. i have tried this but all column get
value not a particular column. my problem is this is invoke in every
column click but i want alert mesage only when third column click of each
row
HTML
<table id='myTable'>
<tr><td>R1C1</td><td>R1C2</td><td>R1C3</td><td>R1C4</td></tr>
<tr><td>R2C1</td><td>R2C2</td><td>R2C3</td><td>R2C4</td></tr>
<tr><td>R3C1</td><td>R3C2</td><td>R3C3</td><td>R3C4</td></tr>
</table>
JS
$("#myTable tr").bind("click", function () {
alert($(this).children("td").eq(3).html());
});
No comments:
Post a Comment