“onchange” event delayed in IE? (ok with Firefox)

前端 未结 6 1515
臣服心动
臣服心动 2020-12-10 07:56

It might be a beginner question but I can\'t understand why the onchange event is never called by IE while it works Ok with firefox.



        
6条回答
  •  误落风尘
    2020-12-10 08:52

    As answered elsewhere, IE doesn't fire the event till you click outside the input field.

    Just a quick expaination of how I fixed it with jQuery. (This is a translation of my code, so it may contain bugs...)

    
    

    ...was changed to...

    
    
    
    

    For those new to jQuery you are basically waiting for the page to become fully loaded, then you are adding the event handler 'dosomething' to the input box.

提交回复
热议问题