Permalink
Browse files

feat(dom): implement createAttribute

  • Loading branch information...
JeroenVinke committed Jul 23, 2017
1 parent d8e6239 commit e926bd93b8bdc323ce7ec12c0a495e1dadb52efd
Showing with 9 additions and 0 deletions.
  1. +6 −0 src/dom.ts
  2. +3 −0 src/nodejs-dom.ts
View
@@ -50,6 +50,12 @@ export interface IDom {
*/
createElement(tagName: string): Element;
/**
* Creates the specified HTML attribute
* @param name A string that specifies the name of attribute to be created.
* @return The created attribute.
*/
createAttribute(name: string): Attr;
/**
* Creates a new Text node.
* @param text A string to populate the new Text node.
* @return A Text node.
View
@@ -26,6 +26,9 @@ export class NodeJsDom implements IDom {
createElement(tagName: string): Element {
return this.global.document.createElement(tagName);
}
createAttribute(name: string): Attr {
return this.global.document.createAttribute(name);
}
createTextNode(text: string): Text {
return this.global.document.createTextNode(text);
}

0 comments on commit e926bd9

Please sign in to comment.