我是 javascript 新手,很难掌握这个概念。我想添加一个是或否表单,提交时提交并累加。
这是html表单:
<form id="selection" name="selection" method="post">
<input type="radio" name="choice" value="yes">Yes<br>
<input type="radio" name="choice" value="no">No<br />
<input type="reset" name="submit" value="Submit" />
</form>
<div id="results">
Voters who said yes are: <label id="yes">0</label><br />
Voters who said no are: <label id="no">0</label><br />
</div>