diff --git a/dom-element.js b/dom-element.js index a79f561..23d06fd 100644 --- a/dom-element.js +++ b/dom-element.js @@ -27,7 +27,7 @@ function DOMElement(tagName, owner, namespace) { this._attributes = {} if (this.tagName === 'INPUT') { - this.type = 'text' + this.setAttribute('type', 'text') } } diff --git a/test/test-document.js b/test/test-document.js index 8f44e90..7c0f230 100644 --- a/test/test-document.js +++ b/test/test-document.js @@ -326,8 +326,10 @@ function testDocument(document) { test("input has type=text by default", function (assert) { var elem = document.createElement("input") - assert.equal(elem.type, "text"); + assert.equal(elem.getAttribute("type"), "text"); assert.equal(elemString(elem), "") + elem.setAttribute("type", "file") + assert.equal(elemString(elem), "") assert.end() })