dimanche 15 février 2015

Can you use "this" attribute on onclick of an HTML tag?


Can you use the this tag for the onclick on an HTML tag? Here's my JS code...



function changeImage() {
this/*<-- right there <--*/.src=a;
}
document.getElementsByTagName('img').onclick = function(){
changeImage();
} ;


Am I doing something wrong?





Aucun commentaire:

Enregistrer un commentaire