I am having trouble getting this to work properly I only have one check box if its check I want it to return Yes if its not checked I would like it to return 0 or whatever it does when its not checked. For some reason it is always getting passed as “Yes” can someone spot the error in my code I have been looking at other posts and it seems like I have it setup right.
<input type="checkbox" id="lunchCheck" value="Yes" name="lunch" checked />
Here is my javascript where I get the value
window.lunch = document.getElementById("lunchCheck").value;
Check the “checked” property.