You are on page 1of 2

Practical No7: Create a web

page to implement Form


Events Part I

Program No: 1
onclick:

<html> Program No:2


<head> Onbdbclick:
<title>onClick Demo</title>
</head> <html>
<script> <head>
function i1() <title>ondblClick Demo</title>
{ </head>
alert("WELCOME TO INDIA"); <script >
} function message()
function i2() {
{ alert("double clicked...");
alert("WELCOME TO USA"); }
} </script>
function i3() </head>
{ <form>
alert("WELCOME TO CHINA"); <input type="button" name="b1"
} value="India" ondblclick="message()">
</script> </form>
</head> </html>
<form>
<input type="button" name="b1" Output:
value="India" onclick="i1()">
<input type="button" name="b2"
value="USA" onclick="i2()">
<input type="button" name="b3"
value="China" onclick="i3()">
</form>
</html>

Output:

Program No: 3
Onmousemove:
<html> <input type="button" name="b1"
<head>
value="Click" onmouseover="over()"
<title>Mouse event Demo</title>
</head> onmouseout="out()">
<script> </form>
function move() </html>
{
alert("Mouse moves");
Output:
}
</script>
</head>
<form name="frm1">
<textarea name="ta1" rows="10"
cols="10" onmousemove="move()">
write here...
</textarea>
</form>
</html>

Output:

Program No:4
onmouseover & onmouseout:

<html>
<head>
<title>Mouse event Demo</title>
</head>
<script>
function over()
{
document.frm1.b1.value="Mouse Over";
}
function out()
{
document.frm1.b1.value="Mouse Out";
}
</script>
</head>
<form name="frm1">

You might also like