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>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM