Event Handler with Multiple Statements in Attribute Value : Variable Definition « Language Basics « JavaScript DHTML






Event Handler with Multiple Statements in Attribute Value

  
<HTML>
<HEAD>
<TITLE>Event Handler With Multiple Statements</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
    count=0
//-->
</SCRIPT>
</HEAD>
<BODY>
<H1>Event Handler With Multiple Statements</H1>
<P><A HREF="http://www.java2s.com" ONMOUSEOVER='++count;
alert("You moved your mouse here "+count+" times!")'>Displays
the number of times you move your mouse over this link.</A></P>
</BODY>
</HTML>
           
         
    
  








Related examples in the same category

1.The Effects of Local and Global Variables
2.Use of Global and Local Variables
3.Global and Local Variable Scope Demonstration
4.Global Versus Local Scope of a Variable
5.Variable scope
6.Variable scoping
7.Get the type of a variable
8.Global scope and page scope
9.String value is passed by value, while the array is passed by reference