在许多情况下,我有如下复选框
<input type="checkbox" name="custom7" value="1" id="custom7"
checked="checked"> <label for="custom7">Email me more info?</label>
Now when the checkbox is checked the value should be 1 as in value=1 .如果未选中该复选框,我希望该值为零,如 value=0。我怎样才能做到这一点?
原文由 Hello Universe 发布,翻译遵循 CC BY-SA 4.0 许可协议
谢谢你的工作
链接:http: //jsfiddle.net/WhQaR/