Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
input elements have type=text by default
  • Loading branch information
avh4 committed Jun 13, 2014
1 parent c613582 commit 3648e81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dom-element.js
Expand Up @@ -22,6 +22,10 @@ function DOMElement(tagName, owner, namespace) {
this.style = {} this.style = {}
this.ownerDocument = owner || null this.ownerDocument = owner || null
this.namespaceURI = ns this.namespaceURI = ns

if (this.tagName === 'INPUT') {
this.type = 'text'
}
} }


DOMElement.prototype.type = "DOMElement" DOMElement.prototype.type = "DOMElement"
Expand Down
5 changes: 5 additions & 0 deletions test/test-document.js
Expand Up @@ -255,6 +255,11 @@ function testDocument(document) {
assert.end() assert.end()
}) })


test("input has type=text by default", function (assert) {
assert.equal(document.createElement("input").type, "text");
assert.end()
})

function elemString(element) { function elemString(element) {
var html = String(element) || "[]" var html = String(element) || "[]"


Expand Down

0 comments on commit 3648e81

Please sign in to comment.