谁能帮助我在这里做错了什么?
HTML
<div id="usercurrentccbox">
<div class="cardChoice">
<label for="mastercard"></label>
</div>
</div>
查询
$(document).ready(function(){
var cct = "mastercard";
//$('#usercurrentccbox .cardChoice label[for=mastercard]').addClass("active");
$('#usercurrentccbox .cardChoice label[for="'+cct+'"').addClass("active");
});
CSS
label{
position:relative;
float:left;
width:200px;
height:170px;
border:1px solid #000;
}
label.active{
border: 1px solid #d6d6d6;
}