diff options
Diffstat (limited to 'src/elements/Dom.js')
-rw-r--r-- | src/elements/Dom.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/elements/Dom.js b/src/elements/Dom.js index 75f3e94..899da77 100644 --- a/src/elements/Dom.js +++ b/src/elements/Dom.js @@ -11,10 +11,14 @@ import EventTarget from '../types/EventTarget.js' import attr from '../modules/core/attr.js' export default class Dom extends EventTarget { - constructor (node) { + constructor (node, attrs) { super(node) this.node = node this.type = node.nodeName + + if (attrs && node !== attrs) { + this.attr(attrs) + } } // Add given element at a position |