html - Jquery delay disabled -


why following code doesn't work? want input disabled 1 second , go normal again.

$('#chat_bg').attr('disabled', true).delay(1).$('#chat_bg').attr('disabled', false); 

aside syntactically invalid javascript, , fact .delay() interprets argument milliseconds, not seconds:

.delay() affect events queue default, .attr() not interact with.

keep simple, , use settimeout.

var $elt = $('#chat_bg').attr('disabled', true); settimeout(function () {     $elt.attr('disabled', false); }, 1000); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -