radio标签 onchange事件
作者:互联网
1、radio标签
<input type="radio" id="ZX2_BLX_AB005" name="zx_zx_blx" value="AB005" />
<label for="ZX2_BLX_AB005">主项</label>
<input type="radio" id="ZX2_BLX_AB006" name="zx_zx_blx" value="AB006" checked="checked" />
<label for="ZX2_BLX_AB006">子项</label>
<input type="radio" id="ZX2_BLX_AB007" name="zx_zx_blx" value="AB007" />
<label for="ZX2_BLX_AB007">办理项</label>
2、onchange 实现
<script type="text/javascript">
$(document).ready(function(){
$('input[type=radio][name=zx_zx_blx]').change(function() {
if (this.value == 'AB005') {
console.log('AB005');
} else if (this.value == 'AB006') {
console.log('AB006');
} else if (this.value == 'AB007') {
console.log('AB005');
}
});
});
</script>
标签:console,log,标签,AB005,value,radio,zx,onchange 来源: https://www.cnblogs.com/zcx-94/p/12575911.html