Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Enregistrer le code
Ctrl+Alt+A
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <body> <h1>Événements HTML JavaScript</h1> <h2>L'attribut onmousedown</h2> <div onmousedown="mDown(this)" onmouseup="mUp(this)" style="background-color:#D94A38;width:90px;height:20px;padding:40px;"> Click Me</div> <script> function mDown(obj) { obj.style.backgroundColor = "#1ec5e5"; obj.innerHTML = "Libère-moi"; } function mUp(obj) { obj.style.backgroundColor="#D94A38"; obj.innerHTML="Merci"; } </script> </body> </html>