I want to change the word in the span tag every 1.5 seconds, but for now it just displays the last word in the list of arrays.
Here is my javascript
var list = [ "websites", "user interfaces" ]; setInterval(function() { for(var count = 0; count < list.length; count++) { document.getElementById("word").innerHTML = list[count]; }}, 1500);
And here is the html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <span id="word"></span> </body> </html>
javascript arrays html loops for-loop
Jake123
source share