jquery 单选框radio改变事件

  • A+
所属分类:JQuery/Js 技术杂谈

单选框改变事件:

<input type="radio" name="department"  checked="checked" value="personnel">人事
<input 惹="radio" name="department" value="administrative">行政
<input type="radio" name="department" value="financial">财务
<input type="radio" name="department" value="sales">销售

jquery:

$(document).ready(function() {
    $('input[type=radio][name=department]').change(function() {
        alert(this.value);
    });
});

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: