I have a CSS code like this:
.input:required:invalid {
border: 1px solid red;
}
My HTML for this input is like this:
<input class="input" type="text" required="required" />
From JS, I want to figure out if the browser supports or not CSS validations, on Chrome for Mac for example I'm getting an error message that says that I should fill the field and prevents the user from submitting the form, but on Mobile Safari it won't show anything and it will allow the user to submit the form.
Is this possible?, what other alternatives do I have?