diff --git a/sunpy/node/nodes/swapnode.js b/sunpy/node/nodes/swapnode.js index d698447..82aa5c8 100644 --- a/sunpy/node/nodes/swapnode.js +++ b/sunpy/node/nodes/swapnode.js @@ -16,6 +16,12 @@ export class SwapNode extends BaseNode { if (this.hasReplaceNodes) return false; + // Copy id and classes to new node + if (this.node.id) + this.swapNode.id = this.node.id; + if (this.node.classList.length) + this.swapNode.classList = this.node.classList; + this.linker(this.node, this.swapNode); this.node.parentNode.replaceChild(this.swapNode, this.node); diff --git a/tests/init.html b/tests/init.html index 5cd3603..d64ae1b 100644 --- a/tests/init.html +++ b/tests/init.html @@ -21,10 +21,10 @@ - -