Avatar of hankknight
hankknight
Flag for Canada

asked on 

document.getElementById for span inside div with ID

This toggles the display for my div:
        <div id="loadingTab"><span>Loading&hellip;</span></div>

Instead I only want to toggle the display for the <span> inside the div
        <div id="loadingTab"><span>Loading&hellip;</span></div>

function blinkIt() {
	var b = document.getElementById("loadingTab");
	if( b.style.display=="block" ) {b.style.display="none";}
	else {b.style.display="block";}
	}

Open in new window

JavaScript

Avatar of undefined
Last Comment
ludofulop

8/22/2022 - Mon