input的一些验证和样式
2021-01-11
input[type="radio"] + label::before {
content: "\a0"; /*不换行空格*/
display: inline-block;
vertical-align: middle;
width: 1em;
height: 1em;
margin-right: .4em;
border-radius: 50%;
text-indent: .15em;
line-height: 1;
background: url('../img/select_b.png');
background-size: 100%;
z-index: 18;
position: relative;
}
input[type="radio"]:checked + label::before {
background-clip: content-box;
background: url('../img/select_h.png');
background-size: 100%;
position: relative;
}
input[type="radio"] {
position: absolute;
clip: rect(0, 0, 0, 0);
}
<div class="select_a_div">
<input type="radio" id="xuanxianga" name="zhongyin" />
<label for="xuanxianga">label>
div>
<div class="select_b_div">
<input type="radio" id="xuanxiangb" name="zhongyin" />
<label for="xuanxiangb">label>
div>
$("#xuanxianga").prop("checked","checked");
坑
**如果你的jQuery库的版本是1.6以下的,使用attr方法
如果你的jquery库的版本是1.6(含1.6)以上的,使用prop方法**
$(':radio[value='+data[2]+']').prop('checked',true);
2021-01-11
2021-01-11
2021-08-15
2021-07-01
2021-10-11
2021-01-11
2021-04-28
2021-01-13
评论