Member-only story
5 Tricks to Truly Call Yourself HTML master
HTML is a language that everyone knows, but very few people truly know. To be honest, when you are just starting off, you can get away with only the basics of HTML, but in the long term, not knowing the nitty-gritty of the language can hurt your application a lot.
Let’s dive in!
Form Validation
The most often used Form Validation Techniques utilize JavaScript:
function validateForm() {
const inputText = document.forms["form-name"]["input-name"].value;
if (!inputText) {
// handle input empty
} else {
// handle input filled
}
}
For most basic cases such as the example above, HTML ships with several powerful validators. The above code can be replaced with just one parameter: required
<form>
<input required="true" />
</form>
Some of the standard validators available for HTML:
Audio
Audio is one of the important aspects of modern UX. Any application can work without it, but add a couple of interaction sounds and your website appeal shoots up instantly.