Text no-wrap in textarea

Giganews Newsgroups
Subject: Text no-wrap in textarea
Posted by:  Dr J R Stockton (reply10…@merlyn.demon.co.uk)
Date: Thu, 11 Nov 2010

I have a form written in HTML including  <textarea wrap=off ... , and
the textarea will be narrower than some of the text lines in its value
property.

That "wrap=off" means that long lines in the area are not wrapped but
continue invisibly to the right; they can be scrolled into view.

I now need to create a matching textarea using JavaScript instead of
HTML.

I have    TxAr = document.createElement("textarea")

What code do I put to get a matching visual effect?  Either setting a
property of TxAr or one of TxAr.style, I suppose.

        ( Actually, it's not essential that it look like a textarea; but
          it must look and behave like a PRE with X & Y scrollbars.  It
          is not submitted. )

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk  Turnpike v6.05  IE 8.
Web  http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and links.
Command-prompt MiniTrue is useful for viewing/searching/altering files. Free,
DOS/Win/UNIX now 2.0.6; see <URLhttp://www.merlyn.demon.co.uk/pc-links.htm>.

Replies