I think this would be smaller (but confirm with grunt-compare-size) if you pulled the `textContent` check and text node appending into this loop and got rid of `.append`:

```js
if ( typeof elem.textContent === "string" ) {
    elem.textContent = value;
} else {
    elem.appendChild( (elem.ownerDocument || elem).createTextNode( value ) );
}
```