1. How are the two examples different? The main difference between the two codes is
that the first example runs the javascript automatically when the page loads. The second
code uses a so called event, so the code only runs when you click the button
2. Why is the code activated in JS events example? It's activated because it uses the
function onclick event, which basically commands the browser to run the javascript
function when the user clicks it.
3. After comparing the if statement, else, and else if statement the “if…else if…else
structure is the best b/c it lets you test several conditions in order and ensures only one
block of code runs, making programs more efficient and organized.