netsurf/test/js/dom-element-create.html

24 lines
572 B
HTML
Raw Normal View History

2016-02-01 18:36:12 +03:00
<!DOCTYPE html>
<html>
<head>
<title>Create paragraph and inspect its proto</title>
<link rel="stylesheet" type="text/css" href="tst.css">
</head>
<body>
<h1>HTMLElement test of attribute set/remove</h1>
<script>
var e = document.createElement("p");
var t = document.createTextNode("Some text in a paragraph.");
e.appendChild(t);
e.setAttribute("id", "test");
document.body.appendChild(e);
</script>
<script>
var test = document.getElementById("test");
document.write("<p>Paragraph element proto: ", test, ".</p>");
</script>
</body>
</html>