Events are used to perform the click functions or trigger actions in HTML
<h2> click on the button to open the value</h2> <button onclick="myfunction()">Click ME</button> <p id="demo"></p> <p>manideep sudheer</p> <script> function myfunction() { document.getElementById("demo").innerHTML = "helloTechFunda"; } </script>
output
It is used to double click the events
<h2> Double click on the button to open the value</h2> <button ondblclick="myfunction()">Click ME</button> <p id="demo"></p> <p>manideep sudheer</p> <script> function myfunction() { document.getElementById("demo").innerHTML = "Learn tutorials in techfunda"; } </script>
output
It is used to mouse down and mouse up functions which are used to change the functions when the mouse is placed on the function up or down
<h2> click the text to change the color of the text </h2> <p id="demo" onmousedown="mouseDown()" onmouseup="mouseUp()"> TechFunda is a online tutorials </p> <script> function mouseDown() { document.getElementById("demo").style.color = "blue"; } function mouseUp() { document.getElementById("demo").style.color = "lime"; } </script>
mouse up
and mouse down
.output
It is used to move the mouse to zoom the image when the mouse is moved on it and the image is is normal when the mouse is out
<h2><i>PLace the corsor on the image to change the image</i></h2> <img onmousemove="bigImg(this)" onmouseout="normalImg(this)" src="images/KidsFundaLoga.png"> <p>Techfunda is the best online tutorials </p> <p></p> <script> function bigImg(x) { x.style.height = "164px"; x.style.width = "640px"; } function normalImg(x) { x.style.height = "50px"; x.style.width = "40px"; } </script>
Output
It is used to make the page scroll bu using HTML
<p style="color:green;font-size:30px">Scroll the mouse to change the color</p> <div id="myDIV" onscroll="myFunction()"> Techfunda is a online tutorials for the beginers and dotnetfunda is an online tutorials to learn and share the knowledge with eachother </div> <script> function myFunction() { document.getElementById("myDIV").style.color = "blue"; } </script>
output
Views: 4533 | Post Order: 27