2015-10-29 14:47:53 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2015-10-29 19:50:36 +03:00
|
|
|
<title>dom html div element</title>
|
2015-10-29 14:47:53 +03:00
|
|
|
<link rel="stylesheet" type="text/css" href="tst.css">
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>HTMLDivElement test</h1>
|
|
|
|
|
2016-02-04 18:11:19 +03:00
|
|
|
<noscript><p>Javascript is disabled</p></noscript>
|
2015-10-29 14:47:53 +03:00
|
|
|
<script>
|
|
|
|
var e = document.createElement("Div");
|
|
|
|
var t = document.createTextNode("This text should be aligned right.");
|
|
|
|
e.appendChild(t);
|
|
|
|
e.setAttribute("id", "test");
|
|
|
|
e.align = "right";
|
|
|
|
document.body.appendChild(e);
|
|
|
|
var test = document.getElementById("test");
|
|
|
|
document.write("The align attribute for the above text is set to: ", test.align, ".");
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|