How to bind to browser change of input field? (jQuery)

后端 未结 2 1780
执念已碎
执念已碎 2021-01-16 05:41

Please take a look at this: http://jsfiddle.net/sduBQ/1/

Html:

2条回答
  •  没有蜡笔的小新
    2021-01-16 05:56

    I've haven't run into this myself, but it appears to be a common issue, based on a few quick Google Searches.

    • FireFox capture autocomplete input change event
    • http://bugs.jquery.com/ticket/7830

    One easy hack you could do is set up some code that runs every second or two via setInterval, and checks to see if the field has a value.

    Something like this...

    var code = $('#code');
    var codeTip = $('#codetip');
    var interval = setInterval(function(){
        if (code.val()!=''){
            codeTip.hide();
            clearInterval(interval);
        }
    }, 1000);
    

提交回复
热议问题