I apologize for the simplicity of this question but for some reason I can't figure out for the life of me how to implement using $(this)
in place of $("input:checked")
when looping through inputs to validate a form. If $(this)
is an input how do I concatenate :checked
?
What I'm looking to do is start an if statement regarding the current iteration of input's checked
value so rather than:
if ($("input:checked").val() === undefined) {
//do something
}
something like this (but the below isn't working obviously, hence my question):
if ($(this) + (":checked").val() === undefined) {
//do something
}
Any help would be greatly appreciated.