Hello. I’m going over my past Udemy courses and I’m having trouble understanding the looping part of this. Maybe I just don’t remember how to write them or which one to use for this particular exercise.
The instructions.
100 Button Insanity Exercise
Without touching index.html, please use JavaScript to create exactly 100 new button elements! Add each new button inside the container element provided in index.html. Unfortunately, Udemy’s exercise tool does not support to the append method, so you will need to use appendChild. Here are the steps:
Create exactly 100 new button elements
Each button must have some text inside of it (it doesn’t matter what)
Each button must be appended inside the container div.
Template HTML
<!DOCTYPE html>
<head>
<title>100 Buttons!</title>
</head>
<body>
<!--DO NOT TOUCH THIS FILE PLEASE!-->
<h1>Look At All My Buttons!</h1>
<div id="container">
</div>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button> <button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button> <button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button> <button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button> <button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button> <button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button> <button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button> <button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button> <button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button> <button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
<button>Hi there</button>
</body>
</html>
>
</div>
</body>
</html>
And the JS code is waiting. I only obviously have the buttons setup for now.