You can use the Validate Local HTML function on the web page of the developer toolbar (Chrome and Firefox). This function will use the W3 validator to validate the generated HTML.
Instead of downloading the extension, you can also use my JavaScript shortcut to check local HTML. Bookmark and paste the code below in the "URL" field. Then, when you want to check the local HTML, click on the bookmarklet.
The code below is standalone and does not require any frameworks.
javascript:void(function(){ var form = document.createElement("form"); form.method = "POST"; form.enctype = "multipart/form-data"; form.action = "http://validator.w3.org/check"; form.target = "_blank"; var html = "<html>" + document.documentElement.innerHTML + "</html>"; var post_data = { fragment: html, prefill: "0", doctype: "HTML5", prefill_doctype: "html401", group: "0", ss: "1", outline: "1" }; for(var name in post_data){ (function(){ var t = document.createElement("textarea"); t.name = name; t.value = post_data[name]; form.appendChild(t) })() } document.body.appendChild(form); form.submit(); document.body.removeChild(form); })()
source share