Answer the question
In order to leave comments, you need to log in
JavaScript: Why does replaceWith() return a string and not HTML?
Good afternoon!
Why, in this case, does replaceWith() return a string (HTML entities) and not HTML?
document.querySelectorAll('.entry-content em').forEach(function(entry) {
entry.replaceWith(entry.outerHTML);
// возвращает: <em>Hello!</em>
// а нужно: <em>Hello!</em>
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question