How to hook onclick event for each cell in a table in Javascript?

Posted by MartyIX on Stack Overflow See other posts from Stack Overflow or by MartyIX
Published on 2010-04-21T17:49:26Z Indexed on 2010/04/21 17:53 UTC
Read the original article Hit count: 139

Filed under:
|

I was thinking if there's a better solution for adding onclick handler to each cell in a table than this approach: http://stackoverflow.com/questions/1207939/adding-an-onclick-event-to-a-table-row

Better in the way that I wouldn't need to set "cell.onclick = function" for each cell.

I just need to get the coordinations of a cell where user clicked.

Thanks!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about events