Variable scoping
<html> <head> <title>Scoping Example</title> <script type = "text/javascript" > var aNewVariable = "global."; function myFunction(myPara) { document.write("Global variable within the function: " + aNewVariable); document.write("Local variable within the function: " + myPara); } </script> </head> <body> <script type = "text/javascript" > myFunction("local"); document.write("Global var outside the function: " + aNewVariable); document.write("Local var outside the function: " + myPara); </script> </body> </html>