So I have this code:
jQuery('div[class="someClass"] :input:not(:button)').each(function() {
if (input type is drop-down) {
//do something
}
else {
jQuery(this).attr("value",null);
}
}
I have selected all inputs except buttons in a specific class. Now for each input selected, if the input is a drop-down list I wish to do something, otherwise I wish to set the input to blank, which the last line does. How can this be accomplished?
You could use the
is()method: