Created
May 3, 2017 20:05
-
-
Save giancorzo/39f3ddcb7e77b0b89935295d20adce6e to your computer and use it in GitHub Desktop.
Clide side templating vs Javascript templating
This file contains 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
((title,bodyText) => { | |
var div = document.createElement("div"); | |
div.className = "entry"; | |
var h1 = document.createElement("h1"); | |
var textH1 = document.createTextNode(title); | |
h1.appendChild(textH1); | |
var innerDiv = document.createElement("div"); | |
innerDiv.className = "body"; | |
var innerDivText = document.createTextNode(bodyText); | |
innerDiv.appendChild(innerDivText); | |
div.appendChild(h1); | |
div.appendChild(innerDiv); | |
document.body.appendChild(div); | |
})("Medium story","This is my first post!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment