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>