Given a list of HTML inputs, textareas, and selects, I would like to check and see if any have a name attribute equal to a given string, and if any do, to add a class to it.
For example:
if($('textarea, input, select').attr("name") == "this_name"){
$(this).addClass("myClass");
}
I’m just not sure what I’, doing wrong here, but it doesn’t seem to be working.
try:
Look to use CSS3 selectors within jQuery