- End of class example from last class
- Using Substring to flip first half and second half of string.
There are several methods available to us for querying the DOM.
Some of these return arrays, while getElementById returns a single DOM node. This is important when you query the DOM.
Let's try it out!
Now that we know how to target DOM nodes, let's use them dynamically.
//BASIC EVENT LISTENER
var h1 = document.querySelector('h1');
h1.addEventListener('click', function(e) {
console.log(e);
});
//NOTICE the highlighted section. What does it look like that we've seen before?
A comprehensive list of all the DOM events can be found here.
Write a program that converts temperatures. It should: