<input name='couponRadio' class='Radio' id='ddfd-"+sCouponNO+"' type='radio' value='"+sCouponNO+"'/>
<div></div>
$('.Radio').off('click').on('click',function(){
var titleColor = $(this).next(); //取到当前div
$(".Radio").change(function(){
titleColor.css("background-color","#CCC");//当前颜色
$(".Radio").each(function(){
var selected = this.checked;
if (selected) {
$(this).next().css("background-color","#f59a3d");//选中后div的颜色
}
})
});
});
radio选中当前div变色,其余不变
最新推荐文章于 2024-05-24 16:11:15 发布