Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 - How to set setCustomValidity? [duplicate]

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.');
like image 471
user2952265 Avatar asked Jan 27 '14 11:01

user2952265


1 Answers

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.');
like image 83
Rajesh Dhiman Avatar answered Sep 28 '22 02:09

Rajesh Dhiman