HTML: Why doesn't Firefox use wrap="off" when set by JavaScript?
I'm using this:
$('document').ready(function(){
$('textarea').attr('wrap', 'off');
});
(JQuery) (Firefox 3.5)
I'm checking with WebDeveloper that the wrap attribute indeed is set to off in the page when开发者_如何学C I'm loading it up, but the text still wraps. If I hard-code the invalid HTML of wrap="off"
into the <textarea>
in my HTML, it works fine, but this is invalid HTML and I'm not interested in doing that. When using spellcheck="false" in JavaScript you actually have to pass it the keyword false instead of a string "false". I tried to apply this same principle using false instead of "off", but it didn't work.
This seems to be a phenomenon happening with Firefox and Opera. See this question
精彩评论