使用 ChildNode.replaceWith();
var span = document.createElement('span'); el.replaceWith(span);
note:
1 must have a parent node of the current node;
2. Alternatively parameter node can be an element node, a text node may be;
使用 ChildNode.replaceWith();
var span = document.createElement('span'); el.replaceWith(span);
note:
1 must have a parent node of the current node;
2. Alternatively parameter node can be an element node, a text node may be;