Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vlakoff opened this issue Jan 24, 2024 · 0 comments
Open

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

vlakoff opened this issue Jan 24, 2024 · 0 comments

Comments

@vlakoff
Copy link

vlakoff commented Jan 24, 2024

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant