【发布时间】:2019-06-25 16:05:58
【问题描述】:
我的 HTML 页面中有一些复选框。而且每个组件都有属性。如果选中该复选框,我需要获取该值。
以下是我的 HTML 代码
<div class="col-6 col-12-small">
<h4>Document Submited</h4>
<input type="checkbox" id="idcopy" name="checkbox">
<label for="idcopy">NIC Copy</label>
<input type="checkbox" id="birthcertificate" name="checkbox">
<label for="birthcertificate">Birth Certificate</label>
<input type="checkbox" id="nomineeNic" name="checkbox">
<label for="nomineeNic">Nominee NIC copy</label>
<input type="checkbox" id="agreement" name="checkbox">
<label for="agreement">Agreement</label>
</div>
我已经尝试使用 document.getElementById(idcopy).text() 来获取文本
【问题讨论】:
标签: javascript html