site de Fabien Torre


Source de tp3.html

1: <!DOCTYPE html> 2: <html lang="fr"> 3: <head> 4: <title>Actions utilisateur et JavaScript</title> 5: <meta charset="utf-8" /> 6: <link rel="stylesheet" href="idemm.css" /> 7: <script> 8: function retournormal () { 9: document.documentElement.style.backgroundColor='white'; 10: document.documentElement.style.color='black'; 11: document.getElementById('bnuit').style.color='black'; 12: } 13: </script> 14: </head> 15: <body onload="alert('bienvenue...');" 16: onkeydown="if (event.key=='ArrowRight') {alert('au suivant !');}"> 17: 18: <h1>Actions utilisateur et JavaScript</h1> 19: 20: <p> 21: Bla bla bla bla bla bla bla bla bla bla bla bla bla bla 22: bla bla bla bla bla bla bla bla bla bla bla bla bla bla 23: bla bla bla bla bla bla bla bla bla bla bla bla bla bla 24: bla bla bla bla bla bla bla bla bla bla bla bla bla bla 25: </p> 26: 27: <div class="illustration"> 28: <img src="images/chat.jpg" alt="un chat" width="200" 29: onmouseover="alert('ron ron...');" /> 30: </div> 31: 32: <button onclick="alert('clic !');">cliquez ici !</button> 33: 34: <br /> 35: 36: <button id="bnuit" 37: onclick="document.documentElement.style.backgroundColor='black'; 38: document.documentElement.style.color='white'; 39: document.getElementById('bnuit').style.color='red';"> 40: nuit</button> 41: 42: <button onclick="retournormal();">jour</button> 43: 44: <br /> 45: 46: <div class="illustration"> 47: <img id="ecran" src="images/chat.jpg" alt="un chat" width="200" 48: onmouseover="document.getElementById('ecran').src='images/chien.jpg'" 49: onmouseout ="document.getElementById('ecran').setAttribute('src','images/chat.jpg');" /> 50: </div> 51: 52: </body> 53: </html> 54:
Fabien Torre Valid HTML5! Valid CSS!
site de Fabien Torre, université de Lille