tabSpan.addEventListener('click', removeTab([newTab, newContent]));
//Remove tab function removeTab(nodeArr) { return function() { nodeArr.forEach(function(el) { el.parentNode && el.parentNode.removeChild(el); }); } };