I wanted to add the class tab-active
to all the span
tag of the menuMobileTabs
div. What's wrong?
<div id='menuMobileTabs'>
<span>Sidebar</span>
<span>RedeSociais</span>
<span>Menu</span>
<span>Search</span>
</div>
<script>
var menuTabs = document.querySelector('#menuMobileTabs span');
for(var i = 0;i < menuTabs.length;i++){
menuTabs[i].classList.add('tab-active');
}
</script>