Why are we using getElementById when using classes is better than id
Thomas Henley1,881 Points
They do different things. You select a single element with ID. Class is for selecting multiple elements.
It’s more specific and easier to navigate than selecting one element in a huge class category.
Jeff SandersPro Student 7,095 Points
Each page should really only have one H1 element, so id works fine in this case. I'd probably use a class for anything else. To be honest, I'd even use a class for H1 despite what I said in my first sentence. : )