The Element.append() method inserts one or more nodes or strings after the last child of the element (MDN). Strings become Text nodes. It returns undefined.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call el.append. Start with this line.
JavaScript
el.append(node1, node2, …)
Call
What it does
el.append(node1, node2, …)
Primary signature.
el.append(...)
Call with the arguments your case needs.
Built into the browser. Call append(...) on an Element — no import required.
Library declarations
JavaScript
el.append(node1, node2, …)
Parameters
Parameter
Description
Parent element
Required. Receives the new last children
param1…paramN
Required. Node objects and/or strings
Return Value
Return Value
Description
*
Always undefined
JavaScript Examples
Example 1 — Append an Element
Add a paragraph as the last child of a container.
JavaScript
const box = document.getElementById("box");
const out = document.getElementById("out");
const p = document.createElement("p");
p.textContent = "Hi";
box.append(p);
out.textContent = box.innerHTML;
Pass several items. Nodes and strings can mix in one call.
Keep argument order. First argument is inserted first among the new bits.
One call. Cleaner than several appendChild calls.
Verify. Parent HTML shows text, then the paragraph.
Compatibility
Browser Support
Element.append() is Baseline Widely available on MDN (across browsers since April 2018). It is not Deprecated, Experimental, or Non-standard. Prefer it over appendChild when you need strings or multiple nodes.
✓ Baseline Widely available
Element.append()
Modern ParentNode insert — nodes or strings after the last child. Widely supported since 2018.
2018+Widely available
Google Chrome54+
Supported
Mozilla Firefox49+
Supported
Apple Safari10+
Supported
Microsoft Edge17+
Supported
Opera41+
Supported
Internet ExplorerNot supported — use appendChild
Unavailable
append()Baseline
Bottom line: Safe for modern browsers. For very old IE, use appendChild (one Node at a time).
Frequently Asked Questions
It inserts one or more Node objects or strings after the last child of the element (MDN). Strings become Text nodes.
No. MDN marks Element.append() as Baseline Widely available (across browsers since April 2018). It is not Deprecated, Experimental, or Non-standard.
append() can take multiple nodes and strings, and returns undefined. appendChild() accepts only one Node and returns that child (MDN).
Nothing useful — the return value is undefined. Inspect childNodes or innerHTML to verify what was added.
Yes. Pass a string: el.append("Hello"). The browser creates a Text node for you.
Like appendChild, append moves it to the new parent. Use cloneNode() if you need a copy.