$('input:radio').bind("click", function () {
// alert("11");
var cs = $(this).attr('class').toString();
var a = $(this).attr('id').toString();
var c = cs.substring(0, 4);
// alert("22");
if (c == "yxdk") {
$('#cardNo').show();
$('#cardPwd').show();
}
else {
$('#cardNo').hide();
$('#cardPwd').hide();
}
if (a == "dkc") {
$('#option_01').addClass('card');
}
else {
$('#option_01').removeClass('card');
}
var ck = $(this).attr('checked');
if (ck == "checked") {
var id = $(this).attr('id').toString();
$("#types").val(id);
}
});
-------------
html代码
# <div id="sj" style=" margin-top:10px;" >
<p style="color:White; padding-left: 8px;display: block;width: 96px;height: 24px;line-height: 24px;background-image: url(../../Images/pane.png);margin-bottom: 5px;margin-left: -8px;">充值卡支付</p>
<input type="radio" id="zhilt" name="rtype" class="yxdk rad" value="LT">
<label name="zhilt" class="label1" for="zhilt">联通卡充值</label>
<input type="radio" id="zhidx" name="rtype" class="yxdk rad" value="DX" >
<label name="zhidx" class="label1" for="zhidx">电信卡充值</label>
<input type="radio" id="zhisz" name="rtype" class="yxdk rad" value="SZ" >
<label name="zhisz" class="label1" for="zhisz">移动卡充值</label>
</div>