Skip to content

Instantly share code, notes, and snippets.

@codepedia
Created March 21, 2018 19:04
Show Gist options
  • Save codepedia/4934f5e7458dfbbc6c36f32e55218380 to your computer and use it in GitHub Desktop.
Save codepedia/4934f5e7458dfbbc6c36f32e55218380 to your computer and use it in GitHub Desktop.
//Your dynamic content
var catImage = "http://n-z.tv/wp-content/uploads/2017/08/cat-1024x683.jpg";
var message = "Hey this is some dynamic content";
var title = "Some Dynamic Content"
//Create the string and insert it into the body (or the "template" for you)
document.body.innerHTML = `
<div>
<h3>${title}</h3>
<img src="${catImage}"/>
<p>${message}</p>
</div>
`---------`---------`---------`---------`---------`---------`---------`---------`---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment