I need to display text that changes every few seconds within a single div.
var blink_speed = 1000; // every 1000 == 1 second, adjust to suit
var t = setInterval(function () {
var ele = document.getElementById('myBlinkingDiv');
ele.style.visibility = (ele.style.visibility == 'hidden' ? '' : 'hidden');
}, blink_speed);
<div id="myBlinkingDiv">Blink 0</div>
<div id="myBlinkingDiv1">Blink 1</div>
<div id="myBlinkingDiv2">Blink 2</div>
<div id="myBlinkingDiv3">Blink 3</div>
<div id="myBlinkingDiv4">Blink 4</div>
<div id="myBlinkingDiv5">Blink 5</div>
<div id="myBlinkingDiv6">Blink 6</div>
<div id="myBlinkingDiv7">Blink 7</div>
<div id="myBlinkingDiv8">Blink 8</div>
<div id="myBlinkingDiv9">Blink 9</div>
<div id="myBlinkingDiv10">Blink 10</div>
Unfortunately, my code is not functioning correctly. I'm having trouble implementing an array here.