global objects in javascript
<p>I have 2 files. 1 html and a js. The html file has check boxes. I'm setting a flag when I select a check box. And this flag has to go in the .js file. Based on whether the flag is set or not, I'll be performing some manipulations in the js file. Basically, how do I do this so that the flag set from the html file is available in the javascript file?</p>

<p>Thank you.</p>

<h3>Html file</h3>

<pre><code>function checkWIFI(){

if(document.getElementById('wifi').checked == true) 

wifiFlag.changeFlag(true);

else 

wifiFlag.changeFlag(false); 

}
</code></pre>

<h3>javscript file</h3>

<pre><code>wifiFlag = new testFlag(); 

function testFlag()

{

this.flag = false;

} 

testFlag.prototype.changeFlag = function(newFlag)

{

 this.flag = newFlag; 

} 
</code></pre>
