Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

createElement

Description

The createElement of Document for JS returns an element with localName as local name (if document is an HTML document, localName gets lowercased). The element’s namespace is the HTML namespace when document is an HTML document or document’s content type is "application/xhtml+xml"; otherwise null.

If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown.

When supplied, options’s is can be used to create a customized built-in element.

Syntax

element = document.createElement(localName [, options])

Parameters

localName

A local name.

options

is

Used to create a customized built-in element.

Examples

1 · localName

2 · options

adoptNode

characterSet

compatMode

contentType

createCDATASection

createComment

createDocumentFragment

createElementNS

createProcessingInstruction

createTextNode

doctype

Document

documentElement

documentURI

exitPictureInPicture

getElementsByClassName

getElementsByTagName

getElementsByTagNameNS

implementation

importNode

pictureInPictureEnabled

URL

write

writeln

Web Hypertext Application Technology Working Group (WHATWG)

HomeMenu