/

HTML / CSS / JavaScript Tutorial

JavaScript Document own method: createElement()

[this page | pdf | back links]

The createElement() method (when applied to the document object of the JavaScript DOM) creates a HTML element node.

 

It has the following syntax with the following parameters. It returns an element object, representing the created element.

 

document.createElement(nodetype)

 

Parameter

Required / Optional

Description

nodetype

Required

String specifying the name (type) of element to be created

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile