createElement
Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object.
Syntax
element = element.createElement(type)
Parameters
type is a string that represents the type of element to be created.
Example
div = document.createElement("div"); preface = document.getElementById("preface"); document.insertBefore(div, preface);
Notes
In addition, if there are known attributes with default values, attribute nodes representing them are automatically created and attached to the element.
To create an element with a qualified name and namespace URI, use the createElementNS method.
Specification
Netscape Communications http://developer.netscape.com |