summaryrefslogtreecommitdiff
path: root/test/js/dom-html-div-element.html
blob: 024bc831b1afbee2d2a12abba4dc7b6cbd9e2c53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html>
<head>
<title>dom html div element</title>
<link rel="stylesheet" type="text/css" href="tst.css">
</head>
<body>
<h1>HTMLDivElement test</h1>

<noscript><p>Javascript is disabled</p></noscript>
<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>