Skip to content

Native append() and prepend() handle strings as text nodes #259

@vlakoff

Description

@vlakoff

These two snippets are erroneous:

3.4 Append

// Native (ES6-way): unified syntax
parent.append(newEl | '<div id="container">Hello World</div>');

3.5 Prepend

// Native (ES6-way): unified syntax
parent.prepend(newEl | '<div id="container">Hello World</div>');

When a string is provided, it is handled as a text node, i.e. plain text (just like the textContent property for example), even if it represents HTML markup.

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions