I am trying to select all the tags in the page and register onclick even to them.
onclick
My codes:
document.getElementsByTag
document.getElementsByTagName('a') returns an array thus try this:
document.getElementsByTagName('a')
var arr = document.getElementsByTagName('a'); for(var key in arr){ arr[key].onclick = show; }
Haven't tested it but it should work