Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<template id="testTemplate">
<div class="test-class1"></div>
<div class="test-class2"></div>
<div class="test-class3"></div>
<div id="parent">
<script type="text/javascript">
(function() {
var template = document.getElementById('testTemplate'),
clone, i;
function removeNode(node) {
for (i = 0; i < 1000; ++i) {
clone = document.importNode(template.content, true);
clone.querySelector('.test-class1').innerHTML = 'Firts Column_' + i;
clone.querySelector('.test-class2').innerHTML = 'Second Column_' + i;
clone.querySelector('.test-class3').innerHTML = 'Third Column_' + i;
let slice =;
slice(document.getElementsByClassName('test-class1'), 0).forEach(removeNode);
slice(document.getElementsByClassName('test-class2'), 0).forEach(removeNode);
slice(document.getElementsByClassName('test-class3'), 0).forEach(removeNode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment