diff --git a/README.md b/README.md index bc5c828..07ff1dc 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,9 @@ You can use a really simple pattern to enable your browser modules to run in Nod module.exports = function(text, win) { win = win || window; - win.document.body.innerHTML = `

${text}

`; - return window.document.querySelector('h1'); + const div = win.document.createElement('div'); + div.innerHTML = `

${text}

`; + return div.querySelector('h1'); }; ```