The most viewed posts

Registry Reviver

Web Development Services

Contact Me

How to clean up Windows Computer

About Desktop Icons in Windows Computer

Driver Booster

CCleaner

How to make a computer secure and run faster

Myanmar font and keyboard for Windows

Advanced System Care

The most viewed items

Dell Inspiron 5559

Desktop Hard Disk

Laptop RAM

HP ProBook 430

SONY Playstation Portable

External Hard Disk

Laptop

Please login to start chat

ZilaStar ICT Jul 30 2022, 11:41:01
Category : JavaScript Tutorials

JS Event Listener 2

<!DOCTYPE html>
<html>
<head>
<title>JavaScript Code Testing</title>
</head>
<body>

<button type = "button" id = "event">Try It</button>
<p id = "demo"></p>
<script>
var x = document.getElementById("event");
x.addEventListener("mouseover", jsFun1);
x.addEventListener("mousedown", jsFun2);
x.addEventListener("mouseout", jsFun3);

function jsFun1(){
document.getElementById("demo").innerHTML += "Mouse Over<br />";
}

function jsFun2(){
document.getElementById("demo").innerHTML += "Mouse Down<br />";
}

function jsFun3(){
document.getElementById("demo").innerHTML += "Mouse Out<br />";
}
</script>
</body>
</html>

  • Comments:

    No comment to show.

    To Contact
    Available Services
    Terms and Conditions