点击多选框实现显示对应的图片
点击多选框实现显示对应的图片
<div class="am-list am-list-static am-myyuyue-list ">
<div class="myyuyue-main-head">
<span>免费报价</span>
<p>40分钟前</p>
</div>
<span class="myyuyue-checkbox" id="checkbox"> <input type="checkbox" name="myyuyue-checkbox" value=""> </span>
<i id="myyuyue-foreman"><img src="Content/Image/img/myyuyue-foreman.png"></i>
<div class="myyuyue-main-list">
<p>预约单位:<span>装修公司</span></p>
<p>申请人:<span>赵先生</span></p>
<p>手机号码:<span>1350013500</span></p>
<p>地址:<span>广东省广州市</span></p>
<img src="Content/Image/img/myyuyue-complete.png">
</div>
</div>
<div class="am-list am-list-static am-myyuyue-list ">
<div class="myyuyue-main-head">
<span>免费报价</span>
<p>40分钟前</p>
</div>
<span class="myyuyue-checkbox"> <input type="checkbox" name="myyuyue-checkbox" value=""> </span>
<i id="myyuyue-decoration"><img src="Content/Image/img/myyuyue-decoration.png"></i>
<div class="myyuyue-main-list">
<p>预约单位:<span>免费量房</span></p>
<p>申请人:<span>赵先生</span></p>
<p>手机号码:<span>1350013500</span></p>
<p>地址:<span>广东省广州市</span></p>
<img src="Content/Image/img/myyuyue-complete.png">
</div>
怎么这样实现不了
$(":checkbox").each(function () {
var cheLength = document.getElementsByTagName("div");
$(this).click(function () {
for(var i=0; i<cheLength.length; i++)
{
if ($(this).attr("checked") == "checked") {
$("cheLength img").show();
} else {
$("cheLength img").hide();
}
}
});
});
我勒个来的
9 years, 3 months ago