Language References
Please note that this document describes a technology not included in the W3C HTML 4.0 specification, but is available in both Internet Explorer® and Netscape® Navigator® versions 4 and later.
Sets or retrieves how to handle wordwrapping in the object.
Inline |
<TEXTAREA WRAP = 'soft' | 'hard' | 'off'...> |
Script |
object.wrap = sWrap ] |
soft |
Text is displayed with wordwrapping and submitted without carriage returns and line feeds. |
hard |
Text is displayed with wordwrapping and submitted with soft returns and line feeds. |
off |
Wordwrapping is disabled. The lines appear exactly as the user types them. |
The property is read/write with a default value of soft.
Detecting the difference between soft and hard requires submitting the content within the TEXTAREA to an HTTP server.
The following example dynamically sets the wrap property of a TEXTAREA to one of its possible values.
<script language="JavaScript">
function chgWrap ( oSel, tArea ) {
cVal = oSel.options ( oSel.selectedIndex ).value;
tArea.wrap = cVal;
}
</script>
...
<select id=cboWrap onchange="chgWrap ( this, txt1 )">
<option VALUE=soft>soft
<option VALUE=hard>hard
<option VALUE=off>off
</select>
<p>
<TEXTAREA id=txt1 STYLE="height:200;width:200">
</TEXTAREA>
This feature requires Microsoft® Internet Explorer® 4.0 or later.
Show me
HTMLAREA, TEXTAREA