I know that different doctypes are essentially about how compliant the html is, but what difference does it make what doctype you specify? Do browsers handle the same code differently depending on the doctype? Thanks
UPDATE - most answers mention quirks mode can be set off if no doctype is specified. But what would be the different between xhtml and html 4.01?
The DOCTYPE declaration is required to be compliant to SGML, the language HTML is an instance of.
The DOCTYPE declaration is used by some browsers to trigger different rendering modes.
From Wikipedia:
I decided to quote this text because it answers your question better than I would :). It is important that the absence of a DOCTYPE will trigger "quirks mode" in certain browsers.