Fiddle: https://jsfiddle.net/uafaLstf/1/
I have the following:
$(".span1").html("Warm Welcome To: " + "<br />");
arr = [];
arr.push(["john", "jdoe", "very nice"]);
arr.push(["mike", "mdone", "job well"]);
arr.push(["haan", "hgore", "creative"]);
var interval = 1000;
for (var f = 0; f < arr.length; f++) {
SendWishes(arr[f][0]);
}
function SendWishes(name) {
setTimeout(function () { $(".span1").html($(".span1").html() + name + "<br />"); }, 1000);
}
<span class="span1"></span>
What I am trying to do is display the name after every 1 second... however in my code the entire list is displayed without delay for each entry.
I think I am pretty close and missing something. Can someone please help with my code...