Draw 50 identical images
This task has been done for you. When the "show images" button is clicked, the
drawImagesSame()
function is invoked. This function
creates an HTML image tag (represented as a string), and appends it to the
#output_container
container. It repeats this task 50
times. I want you to undertand this code by studying it carefully:
- Open
loops.js
and examine it. - Note how the container element is targeted using an id selector.
- Note how the element's
insertAdjacentHTML()
method appends the HTML snippet inside of the element, but at the bottom. - Study how the "Clear" button works.