开发者

HTML: Why doesn't Firefox use wrap="off" when set by JavaScript?

开发者 https://www.devze.com 2022-12-18 10:51 出处:网络
I\'m using this: $(\'document\').ready(function(){ $(\'textarea\').attr(\'wrap\', \'off\'); }); (JQuery) (Firefox 3.5)

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

0

精彩评论

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

关注公众号