FrontEnd Development Zero to Hero (31 Part Series)
Data validation is a means of confirming the integrity and correctness of data, just like in other fields, tools are employed for this in HTML.
There are paid products out there for validating HTML documents and there are free options which is the route we will be taking. But the question that might come to your mind is: why validate HTML?
Mistakes do happen when you code and there is a hgh chance you did not close a tag, you left out a required attribute or your open and closing quotes do not match and due to the forgiving nature of HTML you might not notice this error.
If the HTML document you are working on is quite sizeable you can use the browser
viewsource and visually hunt down the errors which are highlighted in red and using your mouse to hover these error you'll get brief information about the error which most of the time is what the browser think you (the developer) should have done.
This approach is not practical if the document is quiet enormous. The W3C has a validator that's free to use and its available online. There are three method for validating your data using this tool:
- Validation by URI
- Validation by file upload
- Validation by direct input
This method of validation allow you to submit the URL of the document (the website address) you want to check and the tool will do the rest.
In this approach you upload a local HTML file to the validator
If the document you want to check is minute, this option is practical. In this regard you copy the HTML source code and paste it into the validator and then validate.
Below is an image that show's a minimal validation result by URI