Use a good validator such as TotalValidator (www.totalvalidator.com), this service also checks your code for WCAG/508 accessibility compliance and even spelling mistakes. TotalValidator can also be downloaded as a desktop tool from www.totalvalidator.com If you don't like TV, you could do worse than using the W3C Validation service (validator.w3.org).
You should always code with doctypes and use validator.w3.org to validate your code to see if it is correct.
You could also use the HTML Validator addon to firefox: addons.mozilla.org
You could also use the HTML Validator addon to firefox: addons.mozilla.org
In addition to the HTML Validator tools (and the Firefox addon (which is great)) you may also find generating your output (HTML, CSS, JS) and then saving a local copy and opening in your editor/IDE to be quite helpful.
The syntax highlighting alone may indicate where you may have problem code... As well as highlight where you have redundant code (e.g. If you output a bunch of empty div's or span's that you weren't aware of (valid code, but junk code))
This also helps you see if you have areas of your code that need cleanup (e.g. Nested tables that aren't needed)
Finally, if you site/app is public, publish the URL and invite others to inspect it... Maybe you have code that renders fine in IE but not in Safari or Firefox.
A fresh set of eyes is always helpful and the criticism (if any) is usually very constructive.
The syntax highlighting alone may indicate where you may have problem code... As well as highlight where you have redundant code (e.g. If you output a bunch of empty div's or span's that you weren't aware of (valid code, but junk code))
This also helps you see if you have areas of your code that need cleanup (e.g. Nested tables that aren't needed)
Finally, if you site/app is public, publish the URL and invite others to inspect it... Maybe you have code that renders fine in IE but not in Safari or Firefox.
A fresh set of eyes is always helpful and the criticism (if any) is usually very constructive.