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>
上一篇:A Dangerous Maze (概率期望)


下一篇:数据库配置相关(转)