TDOMDocument.CreateElement function
Creates an element in the document with the specified tag name.
Declaration
function CreateElement(const tagName: DOMString): TDOMElement; virtualDescription
CreateElement is a
TDOMElement function used to create
a new DOM Element with the tag name specified in tagName.
CreateElement calls Alloc to create the DOM Element in the
internal node pool for the document. The value in tagName is checked for a
QualifiedName matching a Namespace registered in the document, and added to
the Namespace index if it does not already exist. CreateElement calls the
AttachDefaultAttrs method in TDOMElement to add default attribute values
required for the DOM Element.
Errors
Raises an EDOMError exception with the exception code
INVALID_CHARACTER_ERR if tagName does not contain a valid XML name.
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
