How to check if a checkbox is checked or unchecked with javascript?
<p>I am trying to check weather a checkbox is checked or unchecked. This is my code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
function EnableDisableToolTip() {
    if (document.forms[0].help_text.checked) {
        alert("Checked");
    }
    else if (!document.forms[0].help_text.checked) {
    alert("Unchecked");
    }        
}
&lt;/script&gt;


&lt;div id="tooltiponoff"&gt;
&lt;form action=""&gt;
@Html.CheckBox("help_text", true, new { id = "help_text", onclick = "EnableDisableToolTip()" })Hjælpetekst
&lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>It only alerts Unchecked when i click it</p>

<p>Thanks in advance</p>
