JavaScript Events - Javatpoint
JavaScript Events - Javatpoint
Advertisement
JavaScript Events
Ads by
Send feedback
Advertisement
Mouse events:
Keyboard events:
Advertisement
Form events:
ADVERTISEMENT
ADVERTISEMENT
Window/Document events
ADVERTISEMENT
ADVERTISEMENT
Click Event
<html>
<head> Javascript Events </head>
<body>
<script language="Javascript" type="text/Javascript">
<!--
function clickevent()
{
document.write("This is JavaTpoint");
}
//-->
</script>
<form>
<input type="button" onclick="clickevent()" value="W
</form>
</body>
</html>
Test it Now
MouseOver Event
ADVERTISEMENT
ADVERTISEMENT
<html>
<head>
<h1> Javascript Events </h1>
</head>
<body>
<script language="Javascript" type="text/Javascript">
<!--
function mouseoverevent()
{
alert("This is JavaTpoint");
}
//-->
</script>
<p onmouseover="mouseoverevent()"> Keep cursor o
</body>
</html>
Test it Now
Focus Event
ADVERTISEMENT
ADVERTISEMENT
<html>
<head> Javascript Events</head>
<body>
<h2> Enter something here</h2>
<input type="text" id="input1" onfocus="focusevent()
<script>
<!--
function focusevent()
{
document.getElementById("input1").style.backgro
}
//-->
</script>
</body>
</html>
Test it Now
Keydown Event
<html>
<head> Javascript Events</head>
<body>
<h2> Enter something here</h2>
<input type="text" id="input1" onkeydown="keydown
<script>
<!--
function keydownevent()
{
document.getElementById("input1");
alert("Pressed a key");
}
//-->
</script>
</body>
</html>
Test it Now
Load event
<html>
<head>Javascript Events</head>
</br>
<body onload="window.alert('Page successfully loade
<script>
<!--
document.write("The page is loaded successfully");
//-->
</script>
</body>
</html>
Test it Now
← Prev Next →
Feedback
Splunk SPSS
Swagger Transact-SQL
Tumblr ReactJS
Regex Reinforcement
Learning
RxJS tutorial
R Programming RxJS
Keras tutorial
Keras
Preparation
Aptitude
Aptitude Reasoning
Verbal Ability
Company
Questions
Trending Technologies
AWS Tutorial
Artificial AWS
Intelligence
Hadoop ReactJS
Git Tutorial
Blockchain Git
DevOps Tutorial
B.Tech / MCA
DBMS tutorial
Computer Discrete
Organization Mathematics
Ethical Hacking
html tutorial
Automata Tutorial
C++ tutorial
C Programming C++
Java tutorial
Java .Net
Python Programs
Data Warehouse