-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Description
Acknowledgement
- I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment
Node.append
is better than appendChild
in most use cases:
-
Allows appending multiple nodes at once.
-
Supports both Node and string values.
-
Reduces boilerplate and repetitive code.
Example:
el.append("Hello", document.createElement("br"), "world");
vs
el.appendChild(document.createTextNode("Hello"));
el.appendChild(document.createElement("br"));
el.appendChild(document.createTextNode("world"));
Proposal:
Mark appendChild
as @deprecated
in the DOM typings to encourage modern usage.
nmain, whzx5byb and alex-kinokon
Metadata
Metadata
Assignees
Labels
No labels