简体   繁体   English

jQuery的单选按钮更改事件不会触发

[英]Radiobutton change event with jQuery doesn't fire

Here's a JSFiddle example so you see what I mean: 这是一个JSFiddle示例,您将明白我的意思:

http://jsfiddle.net/stapiagutierrez/yVzR5/ http://jsfiddle.net/stapiagutierrez/yVzR5/

The event is supposed to fire on the selection of the payment option change, but it's only firing when I specifically click on the radio button. 该事件应该在选择付款选项更改时触发,但是只有当我特别单击单选按钮时才会触发。

Any ideas? 有任何想法吗?

You will need to trigger the event yourself 您需要自己触发事件

    $('.paymentoption').click(function () {
        $(this).find('input[name="paymenttype"]').prop('checked', true).change();

        // or trigger('change');
    });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM