Browse Source

Don't modify document in example fn to make it less confusing

pull/2/head
Luke Childs 8 years ago
parent
commit
558b1794ca
  1. 5
      README.md

5
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 = `<h1>${text}</h1>`;
return window.document.querySelector('h1');
const div = win.document.createElement('div');
div.innerHTML = `<h1>${text}</h1>`;
return div.querySelector('h1');
};
```

Loading…
Cancel
Save