

Though they may seem similar, HTML Inpsector and the W3C validator are actually completely different tools. How is HTML Inspector different than the W3C Validator? You can choose what rules to run, what options they’re run with, and how the errors are reported. If you disagree with any of the warnings you see or want to log the errors somewhere other than the console, remember that everything in HTML Inspector is customizable. Here’s some sample output from a test I put together: To add HTML Inspector to a page and run it with the default rules and configurations, just add the following lines right before the closing tag, and check out the warnings in the console: HTMLInspector.inspect() HTML Inspector’s only dependency is jQuery, so if you’re not already loading that, you’ll need to. Simply download the latest build and add it to the bottom of one of your pages. The best way to see how HTML Inspector works is to watch it in action. HTML Inspector comes with a set of built-in rules, but if you need more, you can easily write your own. The HTML Inspector rules can then listen for those events, test for certain conditions, and report errors when something unexpected is found. HTML Inspector traverses the DOM and emits events as it goes.

#HTML INSPECTOR WEBSITE HOW TO#
If you want to go deeper and learn more about configuring HTML Inspector or how to write your own rules, please check out the source on Github. This article gives a brief overview of how HTML Inspector works and why someone would want to use it. It’s also extensible and pluggable, making it possible to write your own rules that enforce your chosen conventions. Like JSHint and CSSLint, HTML Inspector is completely customizable, so you can use what you like and ignore what you don’t. It’s written in JavaScript and runs in the browser, so testing your HTML has never been easier. HTML Inspector is a code quality tool to help you and your team write better markup.
