PHP & JavaScript Room :: 設置サンプル

実行結果

対象エレメントのテキスト・ディレクションを取得・設定

ソース

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang='ja'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>対象エレメントのテキスト・ディレクションを取得・設定</title>
</head>
<body id="myBody" dir="rtl">

<script type="text/javascript">
document.write("Text direction: "+document.getElementsByTagName('body')[0].dir+"<br>");
document.write("An alternate way: "+document.getElementById('myBody').dir+"<br>");
</script>

</body>
</html>

polarized women