开发者

Why can't I remove the "disabled" attribute from a textarea using jQuery?

It works when I remove the disabled attribute on an input type tex开发者_StackOverflow社区t field but not textarea, why?

I set the textarea to be disabled like this:

    $('#message').attr('disabled', 'disabled');

which worked, but then later when I did this:

$('#message').removeAttr('disabled');

no luck.

The HTML:

     <textarea id="message">Type here...</textarea>


I'm not seeing what you're saying is happening:

<textarea id="message" disabled="disabled">Type here...</textarea>

<input type="button" value="Enable Me!" />

$(":button").click(function(){
    $("#message").removeAttr("disabled");
});

http://jsfiddle.net/hunter/TRKzQ/


I'm guessing some other javascript error is happening. Is there more code?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜