form.validated-forms:invalid {
button[type="submit"]:not(:disabled) {
opacity: 0.5;
pointer-events: none;
}
}
inputElement.checkValidity()
returns true
when HTML5 validations passed.
<!DOCTYPE html>
<html>
<head>
<title>Hello, World!</title>
</head>
<body>
<form>
<input type="email" onchange="myFunction(this)">
</form>
<script>
function myFunction(e) {
console.log(e.checkValidity());
}
</script>
</body>
</html>