Code
Execute
<!DOCTYPE html> <html> <head> <title>html tutorial - html5 - html code - html form - In 30Sec by Microsoft Award MVP - | wikitechy onmousedown attribute</title> </head> <body> <p onmousedown="mouseDown(this)" onmouseup="mouseUp(this)"> Click Here to check onmousedown Event. <br> Learn to Code in Wikitechy. </p> <script> function mouseDown (obj) { obj.style.color = "red"; } function mouseUp (obj) { obj.style.color = "blue"; } </script> </body> </html>
Result