N
niks
Is there a standard way of traversing the DOM to find all the
javascript in a document? As far as I know, the only legal positions
for javascript in the DOM is within a <script> element or in the event
handlers of other elements. Are there other legal locations?
Finding the <script> tags is easy enough using
document.getElementsByTagName. But locating all event handlers by
traversing the tree of elements and querying for all attributes such as
onclick, onmouseover etc. feel pretty heavy. Is there some simpler way
of doing this?
Thanks in advance,
Nik
javascript in a document? As far as I know, the only legal positions
for javascript in the DOM is within a <script> element or in the event
handlers of other elements. Are there other legal locations?
Finding the <script> tags is easy enough using
document.getElementsByTagName. But locating all event handlers by
traversing the tree of elements and querying for all attributes such as
onclick, onmouseover etc. feel pretty heavy. Is there some simpler way
of doing this?
Thanks in advance,
Nik