Testing if a checkbox is checked
<p>I know the answer is probably staring me in the face, but how do I find out if a checkbox is checked or not?</p>

<pre><code>var sa = document.getElementById("sa").checked;
var test = function () {
    if (sa) {}
    alert("true");
} else {}
alert("false");
}

document.getElementById("button").addEventListener("click", function () {
    test();
}, false);
</code></pre>
