This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

wrap

Summary

Sets the wrap style (soft, hard, or off) for a text element.

Applies to dom/HTMLElement
## Examples

This example dynamically sets the wrap property of a textArea to the value selected by the user.

<script>
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 value=hard>hard
<option value=off>off
</select>
<p>
<textarea id=txt1 style="height:200;width:200"></textarea>

View live example

Notes

Remarks

To detect the difference between soft and hard you must submit the content within the textArea to an HTTP server.

Related specifications

CSS Text Module Level 3
W3C Working Draft

See also

Related pages

  • textArea

Attributions