Skip to content

Instantly share code, notes, and snippets.

@raloliver
Last active February 26, 2017 13:34
Show Gist options
  • Select an option

  • Save raloliver/87ec89c80458f099eed9bb032b30aef4 to your computer and use it in GitHub Desktop.

Select an option

Save raloliver/87ec89c80458f099eed9bb032b30aef4 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<body>
<template id=t>
<div>Hello World!</div>
</template>
<button onclick="stamp()">Stamp</button>
<script>
function stamp() {
var node = document.importNode(document.querySelector('#t').content, true);
document.body.appendChild(node);
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment