Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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

(soft)

Default. 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.

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

textArea

 

 

Show:
© 2014 Microsoft