document.addEventListener('DOMContentLoaded', function () { var li, i; var lists = document.querySelectorAll(ul.tab>li'); for ( i = 0; i<lists.length; i++) { li = lists[i]; li.innerHTML = '<div class="tab-inner">' + li.innerHTML +'</div>'; } })