Thursday, 3 October 2013

Javascript onClick event in all cells

Javascript onClick event in all cells

I'm learning JavaScript and I've not that much experience. But I'm making
a HTML table and I want to add in every table cell (<td>) a onClick event.
<table id="1">
<tr>
<td onClick="tes()">1</td><td onClick="tes()">2</td>
</tr>
<tr>
<td onClick="tes()">3</td><td onClick="tes()">4</td>
</tr>
</table>
Is there another way to do this event in every cell?

No comments:

Post a Comment