How remove word wrap from textarea?

StoneHeart

my simple textarea doesn't show a horizontal bar when text overflows. It wraps text for a new line. So how do I remove wordwrap and display horizontal bar when text overflows?

schnaader

Textareas shouldn't wrap by default, but you can set wrap="soft" to explicitly disable wrap:

<textarea name="nowrap" cols="30" rows="3" wrap="soft"></textarea>

EDIT: The "wrap" attribute is not officially supported. I got it from the german SELFHTML page (an english source is here) that says IE 4.0 and Netscape 2.0 support it. I also tested it in FF 3.0.7 where it works as supposed. Things have changed here, SELFHTML is now a wiki and the english source link is dead.

EDIT2: If you want to be sure every browser supports it, you can use CSS to change wrap behaviour:

Using Cascading Style Sheets (CSS), you can achieve the same effect with white-space: nowrap; overflow: auto;. Thus, the wrap attribute can be regarded as outdated.

From here (seems to be an excellent page with information about textarea).

EDIT3: I'm not sure when it changed (according to the comments, must've been around 2014), but wrap is now an official HTML5 attribute, see w3schools. Changed the answer to match this.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Remove word wrap

Remove word starting by in textarea

How to remove all html tags from textarea if textarea is dynamic?

How to Select a Word from a string in textarea on mouse single click on the word

How to remove HTML tags from ckeditor to textarea

How to remove the resize corner from a textarea element?

Remove scrollbars from textarea

How to get single clicked word from textarea using JavaScript

How to remove a specific word from the beginning of the string?

How to remove unigrams from word dictionary in Python

How to remove a word from ID in jquery?

How to remove word from .split function? (Javascript)

How to remove the word chapter from the chapter headings

How to remove special char from spanish word

How to remove vbVerticalTab from Word Document

how to remove 'ing' from any word

How can I remove a word from a string?

How to remove a corresponding word in a dictionary from a string?

How to remove first word from folder name?

how to remove specific word from an array that is starts with "[ "?

How to remove suffix from a word in c#?

How to remove a word from str in list in dictionary

Remove word-wrap offset in ACE editor

ggplot: how to remove empty groups from a facet_wrap?

How to remove un-parenthesized URLs from a <textarea>

JavaScript - How to remove new line from textarea if no text exists before?

How do I remove default class from textarea in a SilverStripe form

How do I remove Image and Table option from TinyMCE textarea?

textarea wrap hard add new line to the wrapped word