HTML5 - How to set setCustomValidity?
html, javascript, jquery
Solution
Using `jQuery` you could do the following:
$('#numberinput').get(0).setCustomValidity('The two email addresses must match.');
And not:
$('#numberinput').val("").setCustomValidity('The two email addresses must match.');
Problem
How can I address the input field to set the setCustomValidity? It does not work: js fiddle ``` $('#numberinput').val("").setCustomValidity('The two email addresses must match.'); ```
Related problems
- How to show setCustomValidity message/tooltip without submit event
- How to set custom validation messages for HTML forms?
- HTML5/JS/jQuery: On invalid input, mark a different (arbitrary) element as invalid
- How to show setCustomValidity message/tooltip without submit event
- HTML5/JS/jQuery: On invalid input, mark a different (arbitrary) element as invalid