Consider the following code:
<button>Click me!</button>
Answer the following question:
- What is the correct syntax to select the button?
- document.querySelector('Click me!')
- document.querySelector('.button')
- document.querySelector('#button')
- document.querySelector('button')
Take a look at this code:
<button>Click me!</button>
<button>Click me two!</button>
<button>Click me three!</button>
<button>Click me four!</button>
Answer the following questions:
- True or false: document.querySelector('button') will serve our needs to place a click handler on each button.
- True
- False
- To change the text of the button from "Click me!" to "Click me first!", what should we use?
- document.querySelectorAll('button')[0].innerHTML = "Click me first!"
- document.querySelector('button')[0].innerHTML = "Click me first!"
- document...