HTML DOM direction ÊôÐÔ
¶¨ÒåºÍÓ÷¨
direction ÊôÐÔÉèÖÃÔªËØµÄÎı¾·½Ïò¡£
Óï·¨£º
Object.style.direction=ltr|rtl|inherit
Possible Values
Öµ | ÃèÊö |
---|---|
ltr | ĬÈÏ¡£ÄÚÈÝ´Ó×óÏòÓÒÁ÷¶¯¡£ |
rtl | ÄÚÈÝ´ÓÓÒÏò×óÁ÷¶¯¡£ |
inherit | ÄÚÈÝÁ÷¶¯´Ó¸¸ÔªËؼ̳С£ |
ʵÀý
±¾Àý°ÑÎı¾ÉèÖÃΪ´ÓÓÒÏò×óÁ÷¶¯£º
<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>