var $div = $(\'\').appendTo($(\'#header\'));
When creating new elements and adding them to the DOM, do you need the endi
You always need the ending tag to have proper html.
But it is a fact that the majority of browsers let such mistakes slip. It's no reason to be lazy, though, you should not rely on the browsers' tolerance for your code to work. This tolerance is there to be able to display sites with a few mistakes, not to caution deliberately incorrect code.