Override default behaviour for link ('a') objects in Javascript
问题 I don't know if what I'm trying to accomplish is possible at all. I would like to override the default behaviour for all the anchor objects ( A tag) for a given HTML page. I know I can loop through all the A elements and dynamically add an onclick call to each one of them from the body element onload method, but I'm looking for a more absolute solution. What I need is that all A elements get assigned an onclick action which calls a method that passes the element href property as an argument,