Skip to content

Instantly share code, notes, and snippets.

@freshcutdevelopment
Created September 3, 2017 04:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save freshcutdevelopment/02589a2094a91fbb9589934b0dcd2f2b to your computer and use it in GitHub Desktop.
Web components, attaching template content to the DOM
let infoCard = document.querySelector('#info-card');
let bodyElement = document.querySelector('body');
let infoCardInstance = document.importNode(infoCard.content, true);
bodyElement.appendChild(infoCardInstance);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment