var myImage = document.querySelector('img');
myImage.onclick = function() {
var mySrc = myImage.getAttribute('src');
if(mySrc === 'images/firefox-icon.png') {
myImage.setAttribute ('src','images/firefox2.png');
} else {
myImage.setAttribute ('src','images/firefox-icon.png');
}
}document.querySelector('html').onclick = function() {
alert('Hello!!');
}
//is equivalent to
var myHTML = document.querySelector('html');
myHTML.onclick = function() {};