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>
|
|
|
|
|
|
|
|
<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>
|