DOM

document.createElement()

Learn how to use document.createElement() in JavaScript.

document.createElement()

Documentation for document.createElement() in JavaScript.

Syntax

document.createElement("div")

Example

// Practical usage
document.createElement("div")
console.log("Executed successfully.");

Notes

JavaScript provides powerful built-in methods for the web.

Try It Yourself

You can run JavaScript directly in the BrowserCode Playground.