hobby:<input id="x1" type="radio" name="sports" />x1
<input id="x2" type="radio" name="sports" />x2
<input id="x3" type="radio" name="sports" />x3
<input type="button" value="显示" onclick="ShowChecked()">
<br>
<script>
function ShowChecked(){
$("input").css("backgroundColor","");
$("input:checked").css("backgroundColor","red");
}
</script>
选择某个radio后,点击 显示 ,背景颜色没有变红哈?
选择器没问题,问题出现在input[type=radio]的背景显示不了,或者说设置不了背景
你可以设置一下margin试试