jQuery .change() event not firing in IE

后端 未结 5 1238
别跟我提以往
别跟我提以往 2021-01-17 17:19

I\'ve got a dialog that performs a calculation that is dependant on three input fields. When any of them are changed it checks whether they are all filled and if they are i

相关标签:
5条回答
  • 2021-01-17 17:38

    Please try with using each instead of change / click , which is working fine even first time in IE as well as other browsers

    Not Working a first time

    $("#checkboxid").change(function () {
    
    });
    

    Working fine even first time

    $("#checkboxid").each(function () {
    
    });
    
    0 讨论(0)
  • 2021-01-17 17:41

    Use the live function, it usually makes it work ...

    $("#YOURTHING").live("change", function(){
    
    // CODE HERE
    
    });
    
    0 讨论(0)
  • 2021-01-17 17:44

    Using jQuery .on() also might solve your problem. Use it like this :

    jQuery("#ltv-dialog").on("change", "input", function(){
         alert("It works !");
         //your javascript/jQuery goes here
       }
    );
    

    jsfiddle

    0 讨论(0)
  • 2021-01-17 17:56

    I had the same issue: Below fix worked for me:

    Instead of: $("#ltv-dialog input").change( function() {

    I used: $('#ltv-dialog').on('input', function() {

    0 讨论(0)
  • 2021-01-17 17:58

    As you are targeting text input elements, have you tried using a different event? So instead of change use, for example, keyup? $("#ltv-dialog input").keyup( function() {. This will fire after every keypress.

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