Created
January 1, 2017 11:08
-
-
Save davidgilbertson/ade3abb362fb2a9dcdd81071a786d61b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeElement(type, text) { | |
const el = document.createElement(type); | |
const textNode = document.createTextNode(text); | |
el.appendChild(textNode); | |
return el; | |
} | |
const h1 = (text) => makeElement(`h1`, text); | |
// and then | |
document.body.appendChild(h1(`Hello, world.`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment