<html>
<body id="main">
<script>
var body = document.getElementById("main");
var text = document.createElement("p");
text.innerHTML = "Cookies. We use them.";
body.appendChild(text);
</script>
</body>
</html>]]>- A paragraph with the text
Cookies. We use them.
displays inside the body
- The text
p
displays inside the body
- The text
text
displays inside the body
A paragraph with the text Cookies. We use them.
displays inside the body
.