Skip to content Skip to sidebar Skip to footer

Jquery, How To Know When Input Have A :invalid Selector?

I have this code: HTML CSS input[type=text]:invalid { background-color:

Solution 1:

Use the is function to test for the :invalid pseudoclass:

if ($(this).is(":invalid")) {
    showMessage("Invalid value");
}

Example:http://jsbin.com/ikuwur/2/edit

Post a Comment for "Jquery, How To Know When Input Have A :invalid Selector?"