HTML DOM direction Property
Complete Style Object Reference
Definition and Usage
The direction property sets the text direction of an element.
Syntax
Object.style.direction=ltr|rtl|inherit
|
Possible Values
Value |
Description |
ltr |
Default. Content flows from left to right |
rtl |
Content flows from right to left |
inherit |
Content flow is inherited from parent element |
Example
The following example sets the text to flow from right to left:
<html>
<head>
<script type="text/javascript">
function changeTextDirection()
{
document.getElementById("p1").style.direction="rtl";
}
</script>
</head>
<body>
<p id="p1">This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.</p>
<input type="button" onclick="changeTextDirection()"
value="Set text to flow right to left" />
</body>
</html>
|
Try-It-Yourself Demos
direction - Set text to flow from right to left
Complete Style Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|