Monday, November 26, 2012

Javascript events

Javascript events

Javascript is all about cool stuffs displayed in the website. So here we will learn how these cool stuffs happens in the website. This all are the ability of Javascript which increase the user interaction and flash like features.

The building blocks of an interactive web page is the JavaScript event system. An event in JavaScript is something that happens with or on the webpage. A few example of events:
  1.     A mouse click
  2.     The webpage loading
  3.     Mousing over a hot spot on the webpage, also known as hovering
  4.     Selecting an input box in an HTML form
  5.     A keystroke

For example:
<html>
<head>
<script type="text/javascript">
<!--
function popup() {
    alert("Wow!! I feel good.")
}
//-->
</script>
</head>
<body>

<input type="button" value="Click Me!" onclick="popup()"><br />
<a href="#" onmouseover="" onMouseout="popup()">
Hover Me!</a>

</body>
</html>

No comments:

Post a Comment