0
Hidden/shown
How do I make an element hidden then show after a certain amount of seconds.
5 ответов
+ 1
// onload is because SoloLearn lags
window.onload = function(){
// Give the element an ID in HTML
var el = document.getElementById("el");
function toggleEl(){
if (el.style.display == "none"){
el.style.display = "block";
// You may replace "block" with "inline" etc.
}
else{
el.style.display = "none";
}
}
setInterval(toggleEl, 1000);
// That number is milliseconds
// If you don't want it to flash, use...
// setTimeout(toggleEl, 1000);
};
+ 1
James cheers
0
James does not work
0
James im trying to hide the hr element then show it.
0
I fixed it.