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.'); ```

Original source

Related problems