diff --git a/index.js b/index.js index a3e2541..194ea27 100644 --- a/index.js +++ b/index.js @@ -56,6 +56,7 @@ function context () { e.appendChild(r = l) else if ('object' === typeof l) { for (var k in l) { + if(l[k] === false) continue if('function' === typeof l[k]) { if(/^on\w+/.test(k)) { (function (k, l) { // capture k, l in the closure diff --git a/test/index.js b/test/index.js index c007cc5..fac6fb2 100644 --- a/test/index.js +++ b/test/index.js @@ -154,6 +154,12 @@ test('context cleanup removes event handlers', function(t){ t.end() }) +test('false-valued attributes are ignored', function (t) { + t.equal(h('input', {type: 'text', name: 'foo', required: false}).outerHTML, + '') + t.end() +}) + test('unicode selectors', function (t) { t.equal(h('.⛄').outerHTML, '
') t.equal(h('span#⛄').outerHTML, '')