This page is Ready to Use

Notice: The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.

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