-
Notifications
You must be signed in to change notification settings - Fork 1
03 make page
Steve Perry edited this page Oct 24, 2015
·
1 revision
View the source code.
Most of this page is created by JavaScript code.
To create an element, call document.createElement.
To create a text node, call document.createTextNode.
To append a child element to an element, call appendChild.
var par2 = document.createElement("p");
par2.appendChild(document.createTextNode("Hello Steve"));
document.body.appendChild(par2);
To set styles, you can use the style property.
par3.style.color = "red";
par3.style.backgroundColor = "silver";
par3.style.fontSize = "x-large";
To set styles for tables, you can specify CSS styles in a <style> element.
<style>
table {
width: 50%;
border: 5px solid black;
}
td {
border: 3px solid red;
}
</style>