append
The append
method inserts content at the end of the element's content.
Syntax
element.append(content);
element.append(content, options);
Parameters
content
: string- The content to insert at the end of the element's content.
options
: ElementRewriterOptions- An optional object that can have the following properties:
escapeHTML
: boolean- If
true
, any HTML markup incontent
will be escaped so it is safe to insert as text.
- If
- An optional object that can have the following properties:
Examples
// Assuming `e` is an Element representing <div>Hello</div>
e.append(", World");
// Result: <div>Hello, World</div>