diff --git a/lib/api/attributes.js b/lib/api/attributes.js index be0b889b1a..96e0795c66 100644 --- a/lib/api/attributes.js +++ b/lib/api/attributes.js @@ -163,6 +163,9 @@ exports.prop = function (name, value) { case 'outerHTML': property = this.clone().wrap('').parent().html(); break; + case 'innerHTML': + property = this.html(); + break; default: property = getProp(this[0], name); } diff --git a/test/api/attributes.js b/test/api/attributes.js index 6f338fe5f2..6ef8ce0f45 100644 --- a/test/api/attributes.js +++ b/test/api/attributes.js @@ -206,6 +206,12 @@ describe('$(...)', function () { expect($a.prop('outerHTML')).to.be(outerHtml); }); + it('("innerHTML") : should render properly', function () { + var $a = $('
'); + + expect($a.prop('innerHTML')).to.be(''); + }); + it('(inherited properties) : prop should support inherited properties', function () { expect(selectMenu.prop('childNodes')).to.equal(selectMenu[0].childNodes); });