How to remove the "automatic new line" on textarea [duplicate]
Possible Duplicate:
how remove wordwrap from textarea
I have a text area :
<textarea id="areaTL" style='width:700px; height:400px;></textarea>
and I'd like to do a n开发者_运维问答ewline only when there is a \n
into the text, so the horizontal scroll should be larger than the max text inside the textarea.
Tried with :
overflow: scroll; wrap="off"'
but seems it doesnt works. I'd like to do it for Chome/Firefox and IE7+.
How can I do it?
EDIT
Using white-space:nowrap;
as suggested I get this working, but if I do :
textArea=$('#areaTL').val().split('\n');
I get only 1 element in the array, not N. Why?
I believe white-space:nowrap;
is what you're looking for instead of wrap
.
try this it should work
<textarea cols=100 rows=5 wrap='off'>
精彩评论