How do I assign global varaibles in a .js file?

Hema Sudha

All the variables declared between <script> and </script> tags that are independent of any functions defined are initialized before onLoad() function of the page. These are nothing but the Global Variables.

var strMessage = "Hello";
function test() {
Here, strMessage is a global variable.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.