click or change event on radio using jquery

后端 未结 5 1606
挽巷
挽巷 2021-02-06 19:49

I have some radios in my page,and I want to do something when the checked radio changes,however the code does not work in IE:

$(\'input:radio\').change(...);
         


        
5条回答
  •  天涯浪人
    2021-02-06 20:41

    This code worked for me:

    $(function(){
    
        $('input:radio').change(function(){
            alert('changed');   
        });          
    
    });
    

    http://jsfiddle.net/3q29L/

提交回复
热议问题