87,907
社区成员
发帖
与我相关
我的任务
分享
<input type="checkbox" value="螺丝(φ16×230)" name="gongju[]" >螺丝(φ16×230)<div style="display:none;"> <input name="gongjugeshu[]" type="text" size="1" maxlength="2" placeholder="个数"></div>
<input type="checkbox" value="螺丝(φ12×120)" name="gongju[]">螺丝(φ12×120)<div style="display:none;"> <input name="gongjugeshu[]" type="text" size="1" maxlength="2" placeholder="个数"></div>
<input type="checkbox" value="螺丝(φ16×70)" name="gongju[]" >螺丝(φ16×70)<div style="display:none;"> <input name="gongjugeshu[]" type="text" size="1" maxlength="2" placeholder="个数"></div>
<input type="checkbox" value="螺丝(φ16×40)" name="gongju[]">螺丝(φ16×40)<div style="display:none;"> <input name="gongjugeshu[]" type="text" size="1" maxlength="2" placeholder="个数"></div>
<input class="gjitem" type="checkbox" value="螺丝(φ16×230)" name="gongju[]" >螺丝(φ16×230)<div style="display:none;"> <input name="gongjugeshu[]" type="text" size="1" maxlength="2" placeholder="个数"></div>
$(document).ready(function() {
$(".gjitem").click(function(){
if(this.checked){
$(this).next("div").show();
}else{
$(this).next("div").hide();
}
});
});
无效,写在ready外面也无效