I'll give you some advice for the fundamental skills you are developing here.
"What's wrong with my code" questions mean that you haven't tried enough ideas to figure it out on your own. The consummate skill of an excellent programmer is that you know how to look at a problem from many angles, one of which invariably shows you the difficulty. Specifically
Originally Posted by TBerg
I can't believe I had such a small bug making me search for a solution for over two hours. Why wasn't that explained from the very beginning?
Programming is the art of really seeing what you're seeing, not what you think your seeing. The examples you have all omit those tags, why did you add them? Because your brain was in HTML mode, even though the answer was right in front of you. They don't explain this because there are millions of things they could explain, too many to enumerate. Plus the authors probably don't even think of it.
This is the first skill - see what's right in front of your face.
The second skill is the debugger - if you had opened up the debugger (available on Chrome, Safari, etc) you surely would have seen an error message.
The third skill is trying things at random to see if it gives you any insight. You could just start at the top, which happens to be your tag. Comment them out (including the </>) and see what happens. Creative experimentation will usually yield lots of information.
Those three tools will get you farther, and you don't have to bother anybody else with your problems
In a professional environment you'll get eaten alive (usually) for asking a question you could have figured out yourself, but of course you're just starting out. Regardless, using these skills is the important thing, not getting an answer here or there.