wrap attribute | wrap property
Sets or retrieves how to handle wordwrapping in the object.
Syntax
| HTML |
|---|
<element wrap="p" ... > |
| JavaScript |
|---|
p = object.wrap |
Property values
Type: String
-
Default. Text is displayed with wordwrapping and submitted without carriage returns and line feeds.
-
Text is displayed with wordwrapping and submitted with soft returns and line feeds.
-
Wordwrapping is disabled. The lines appear exactly as the user types them.
Remarks
To detect the difference between soft and hard you must submit the content within the textArea to an HTTP server.
Examples
This example dynamically sets the wrap property of a textArea to the value selected by the user.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/wrap.htm
<script type="text/javascript"> function ChangeWrap(oSelect, oTA) { cValue = oSelect.options(oSelect.selectedIndex).value; oTA.wrap = cValue; } </script> ... <select id="cboWrap" onchange="ChangeWrap(this, txt1)"> <option value="soft">soft</option> <option value="hard">hard</option> <option value="off">off</option> </select> <p><textarea id="txt1" style="height: 200; width: 200"></textarea> </p>
See also
Show: