Hi i have created this script to hide a text after 6 seconds, But I want that the text must reappear and disappear again back to the infinite every 6 seconds how I can create th
You can do this by using toggle function on classList
function hide(elementId) { document.getElementById(elementId).classList.toggle('hidden'); } setInterval(hide, 6000, 'xhide');
.hidden { display: none; }
Hello World