如何在几秒钟内text
根据数组打印数组?
例如,我希望“tag1”在 2 秒打印,“tag2”在 4 秒打印,依此类推......time
var time = [2,4,6,8];
var text = ['tag1', 'tag2', 'tag3', 'tag4'];
var e = document.getElementById("teste");
for (var i=0;i<time.length;i++) {
e.innerHTML = text[i];
setTimeout(function(){e.style.display = "none";}, 2000);
}