Saturday, March 17, 2012

ALERT


There are some examples of alert with several events.


<html>

<head>

<title>Example 1</title>

<script language="javascript" type="text/javascript">

window.alert('How are you doing?');

</script>

</head>

<body>

</body>

</html>

________________________________________________

<html>

<head>

<title>Example 2</title>

</head>

<script language="javascript" type="text/javascript">

alert("How do you do?");

</script>

<body>

</body>

</html>

_______________________________________________

<html>

<head>

<title>Example 3</title>

<script language="javascript" type="text/javascript">

 function my_func()

 {window.alert("What is this?");

 }

</script>

</head>

<body>

<input name="My button" type="button" value="click" onClick="my_func()">

</body>

</html>

_______________________________________________

<html>

<head>

<title>Example 4</title>

<script language="javascript" type="text/javascript">

 function my_func()

 {window.alert("What is this?");

 }

</script>

</head>

<body>

<input name="My button" type="button" value="click" onMouseover="my_func()">

</body>

</html>

_______________________________________________

<html>

<head>

<title>Example 5</title>

<script language="javascript" type="text/javascript">

 function my_func()

 {window.alert("What is this?");

 }

</script>

</head>

<body>

<input name="My button" type="button" value="click" onMouseout="my_func()">

</body>

</html>

_______________________________________________

<html>

<head>

<title>Example 6</title>

<script language="javascript" type="text/javascript">

 function my_func()

 {window.alert("What is this?");

 }

</script>

</head>

<body>

<input name="My button" type="button" value="click" onKeypress="my_func()">



</body>

</html>

_______________________________________________

<html>

<head>

<title>Example 7</title>

<script language="javascript" type="text/javascript">

 function my_func()

 {window.alert("What is this?");

 }

</script>

</head>

<body>

<input name="My button" type="button" value="click" onMousedown="my_func()">

</body>

</html>







No comments:

Post a Comment