I was wondering if there was a way of adding JavaScript in every occurrence of a certain HTML tag, e.g.
<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.
What your looking for is most likely “event binding.” This can be done via your script rather than embedded in the HTML code. There are lots of different ways to accomplish such a task, here is one of them using “td” as in your example.