Is there any way to remove all the javascript events from the html tags?
For example
<img src=" " onclick="" />
<img src=" " onerror="" />
I want to strip onclick and onerror from these tags. As in the example, I want to strip all the javascript events from the html tags.
You can do this to clear the events :
Docs for
getElementsByTagName()hereUpdate 1 – All elements on document
If you want to get all of the elements on the document then use
document.getElementsByTagName('*')Update 2 – All events
To clear all events have a look at this answer