如何检查元素内的checkebox? [英] How to checked checkebox inside a element ?
本文介绍了如何检查元素内的checkebox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是html,
< li class = dropdown-submenu >
< a tabindex = - 1 href = # >
< 输入 type = 复选框 class = DDLProductCate value = 1 >
建筑产品
< / a >
< ul class = 下拉菜单 >
< li >
< a href = # >
< 输入 class = DDLProductCate value = 5 type = 复选框 >
水泥
< / a >
< / li >
< li >
< a < span class =code-attribute> href = # >
< 输入 class = DDLProductCate value = 6 type = 复选框 >
钢铁
< / a >
< / li >
< / ul >
< / li >
我尝试了什么:
如果点击它时如何选中复选框'一个'元素文本?
请帮助我...
解决方案
尝试将其放入标签:< br $>
< a href =#>
< label>
< input type =checkbox/>点击查看
< / label>
< / a>
Here is the html,
<li class="dropdown-submenu">
<a tabindex="-1" href="#">
<input type="checkbox" class="DDLProductCate" value="1">
Construction Products
</a>
<ul class="dropdown-menu">
<li>
<a href="#">
<input class="DDLProductCate" value="5" type="checkbox">
Cement
</a>
</li>
<li>
<a href="#">
<input class="DDLProductCate" value="6" type="checkbox">
Steel
</a>
</li>
</ul>
</li>
What I have tried:
How can I check a checkbox when clicks its on 'a' element text?
please help me...
解决方案
Try to put it in a label:
<a href="#"> <label> <input type="checkbox" /> click to check </label> </a>
这篇关于如何检查元素内的checkebox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文