是否可以遍歷此數組並逐個返回數組中的HTML引號 - 在每次按下按鈕之後?循環遍歷循環並返回數組中的字符串
這是我的一段代碼我想不通:
var quotes = ['"Time you enjoy wasting is not wasted time."',
'"You can have it all. Just not all at once."',
'"They say I am old-fashioned, and live in the past, but sometimes I think
progress progresses too fast!"'];
document.getElementById("btn1").addEventListener("click", newQuote);
function newQuote(){
for (var i = 0; i < quotes.length; i++) {
document.getElementById("quote").innerHTML = quotes[i];
}
}
比k你的答案! – NJV