jQuery (mobile) not triggering .change event on Phonegap app

后端 未结 1 624
予麋鹿
予麋鹿 2021-01-20 10:47

(because 2 days I had no issues with this...)

I have a multipage layout, in one of my pages I have a structure like so:

相关标签:
1条回答
  • 2021-01-20 11:50

    Change your code from:

    $("#auto_renew").change(function(){
        alert("Changed!");
    });
    

    To:

    $(document).on('change','#auto_renew',function(){ 
        alert("Changed!"); 
    });
    

    When you bind an event like this it will act as an event delegation. Basically object don't need to exist in a DOM when you execute this binding.

    0 讨论(0)
提交回复
热议问题