Adding javascript to every occurrence of a certain HTML element

Posted by Acorn on Stack Overflow See other posts from Stack Overflow or by Acorn
Published on 2010-04-07T18:20:02Z Indexed on 2010/04/07 18:23 UTC
Read the original article Hit count: 234

Filed under:
|

I was wondering if there was a way of adding javascript in every occurrence of a certain HTML tag, eg.

<td onmousedown="">

At the moment I just have it in every single one of my td tags in my table, but there must be a cleaner way. Something like adding javascript in the way CSS adds formatting.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html