我想在检查主复选框时动态检查子复选框。我想使用 ReactJS 来实现这一点,这是我的代码片段。
ul {
list-style-type: none;
}
<div>
<input type="checkbox" id="fullbody" />
<label htmlFor="fullbody">Download the points for the full body</label>
<ul>
<li><input type='checkbox' id="upperbody"/>Download only the upper body points</li>
<li><input type='checkbox' id="lowerbody" />Download only the lower body points</li>
<li><input type='checkbox' id="head" />Download only the head points</li>
<li><input type='checkbox' id="fullhands" />Download both hands points</li>
<li><input type='checkbox' id="lefthand" />Download left hand points</li>
<li><input type='checkbox' id="righthand" />Download right hand points</li>
</ul>
</div>
所以我的问题是,如何在fullbody
选中时动态检查子复选框?
拉风的咖菲猫
弑天下
相关分类