JQuery. Check value of select box and textbox with same class, Is it possible?
- by Cesar Lopez
I have several select boxes and textboxes with the same class and I have the following statement.
if ($('.selTxtClass:visible').val() == "") {
$('.selTxtClass:visible').focus();
}
}
If I do an alert with ($('.selTxtClass:visible').val()) it comes as undefined.
I want to check that the value of these elements are empty, but I cant see what is wrong with this if statement, could you give me a hand, please?
Thanks a lot.