如何在选择时更改单选按钮背景颜色?
$("input[type='radio']").click(function(e) {
$("input[type='radio']").css('background-color', '#ff0000');
});
Run Code Online (Sandbox Code Playgroud)
我试过这个..但它不起作用.
它不工作.我忘了分享我的代码
<fieldset data-role="controlgroup" id="custom-fieldset"> <span>Were you able to complete your visit today?</span><br/><input type="radio" id="radio_1134198__4516395" name="sdid_1134198" value="radio_1134198__4516395" /><label for="radio_1134198__4516395">Yes</label>
我得到了这样的结果http://i.stack.imgur.com/SDGeZ.png.单选按钮颜色必须更改.
css jquery jquery-mobile jquery-mobile-radio jquery-mobile-fieldset
我在我的jQuery移动应用程序中有以下单选按钮,我需要将它们设置为下图中的单选按钮.我试过以下css但它没有给我相同的结果,请帮帮我..

HTML
<div data-role="page">
<div data-role="header" data-theme="b" style="height:63px;">
</div>
<div data-role="content">
<form>
<fieldset>
<input type="radio" id="Male" value=" Male" name="radio-group-1" />
<label for="Male" data-inline="true" style="background:transparent !important;">Male </label>
<input type="radio" id="Female" value=" Female" name="radio-group-1" />
<label for="Female" data-inline="true" style="background:transparent !important;" >Female </label>
</fieldset>
</form>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
input[type="radio"] {
display: none;
}
.ui-btn.ui-radio-off:after, .ui-btn.ui-radio-on:after{
width: 25px;
height: 25px;
}
.ui-btn.ui-radio-off:after, .ui-btn.ui-radio-on:after{
margin-top: -18px;
margin-left: -38px;
}
.ui-btn.ui-radio-on:after{
width: 55px;
height: 55px;
background: green !important;
background-size:100px 24px;
}
Run Code Online (Sandbox Code Playgroud)
这就是我得到的 