이 배열을 반복하고 배열에서 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