Exercici 3 Events
De wikiserver
Pagina html:
<HTML> <HEAD> <TITLE> EXERCICI 3 </TITLE> <script src="exercici3.js"></script> </HEAD> <BODY> <img width="200px" height="100px" id="imagen" src="google.jpg" alt="imagen"/> </BODY> </HTML>
Javascript :
window.onload=function(){ document.getElementById("imagen").onmouseover=function(){ this.src="google2.jpg" //document.getElementById("imagen").src="google2.jpg" } document.getElementById("imagen").onmouseout=function(){ this.src="google.jpg" } }