You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Using domUtils.replaceElement(element, ???), how can I create a new element to replace with? I'm looking for something like domUtils.createElement('div', { id: 'some-id' }) or equivalent.
Thanks!
The text was updated successfully, but these errors were encountered:
Use htmlparser2 to parse an HTML string and then replace the element with the result.
var html = '<div id="some-id"></div>';
var domHandler = new DomHandler(function(err, elems) {
DomUtils.replaceElement(elem, elems[0]);
});
var parser = new HTMLParser.Parser(domHandler);
parser.write(html);
parser.end();
Hi! Using
domUtils.replaceElement(element, ???)
, how can I create a new element to replace with? I'm looking for something likedomUtils.createElement('div', { id: 'some-id' })
or equivalent.Thanks!
The text was updated successfully, but these errors were encountered: