我正在使用这个:
$('document').ready(function(){
$('textarea').attr('wrap', 'off');
});
(JQuery) (Firefox 3.5)
我正在向 WebDeveloper 检查,当我加载页面时,换行属性确实在页面中设置为关闭,但文本仍然换行。如果我将 wrap="off"
的无效 HTML 硬编码到 HTML 中的
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 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.
发布评论
评论(1)
这似乎是 Firefox 和 Opera 中发生的现象。请参阅此问题
This seems to be a phenomenon happening with Firefox and Opera. See this question