Variable scope : Variable Definition : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » Variable Definition »

 

Variable scope



<html>
<head>
<script language="JavaScript">
<!--
var myVar = "Outside";
function testFunction() {
  var myVar = "Inside";
  alert("this.myVar: " this.myVar);
  alert("myVar: " + myVar);
}
testFunction();
//-->
</script>
</head>
</html>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» Variable Definition