Calling function while creating form elements in javascript
<pre><code>&lt;script language="javascript" type="text/javascript"&gt;
var a =10;
function test()
{
 if ( a ==10) {
   document.sample.checkbox1.checked = true ; 
  }

}

&lt;/script&gt;

&lt;form name="sample"&gt;

 &lt;input type="checkbox" name="checkBox1" test();&gt;Option

&lt;/form&gt;
</code></pre>

<p>While creating form itself its automatically call function based on it should decide whether its need to checked or not .. </p>

<p>Here the question . How  to call the function without any click ( on click event ) </p>

<p>Thanks , 
Chells</p>
