我需要提示访问者三件事,然后用“for循环”和HTML<ol>
和<li>
这就是我所拥有的,但它不起作用:
<script>
var favbook1 = prompt("What is your favotire first book?", "");
var favbook2 = prompt("What is your favotire second book?", "");
var favbook3 = prompt("What is your favotire third book?", "");
books[0] = favbook1;
books[1] = favbook2;
books[2] = favbook3;
for (var i = 0; i < books.lenght ; i++) {
document.write(books[i] , "<br>")
}
</script>
谢谢您的帮助!