Skip to content

Instantly share code, notes, and snippets.

@giancorzo
Created May 3, 2017 20:05
Show Gist options
  • Save giancorzo/39f3ddcb7e77b0b89935295d20adce6e to your computer and use it in GitHub Desktop.
Save giancorzo/39f3ddcb7e77b0b89935295d20adce6e to your computer and use it in GitHub Desktop.
Clide side templating vs Javascript templating
((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