Onclick and Onload
Onclick and Onload
Onclick and Onload
</html>
2. Onchange
<html>
<body>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("mySelect").value;
document.getElementById("demo").innerHTML = "You selected: " + x;
}
</script>
</body>
</html>
3.onchange
<html>
<head>
<script type = "text/javascript">
<!--
function over() {
document.write ("Mouse Over");
}
function out() {
document.write ("Mouse Out");
}
//-->
</script>
</head>
<body>
<p>Bring your mouse inside the division to see the result:</p>
<div onmouseover = "over()" >
<h2> This is inside the division </h2>
</div>
<button onmouseout = "out()">event</button>
</body>
</html>
4. onkeypress
<html>
<body>
<script>
function myFunction() {
alert("key pressed");
}
</script>
</body>
</html>
5. ondblclick
<html>
<body>
<script>
function my() {
document.write("hello");
}
</script>
</body>
</html>