I am checking for each required fields in a form. I tried this but it only works for the first input. How can I make it work for each input?
if($(\'[require
Use the each() function (doc):
each()
$('[required]').each(function() { if($('[required]').val() != ''){ $('.button1').fadeIn(0); $('.button2').fadeOut(0); }else{ $('.button1').fadeOut(0); $('.button2').fadeIn(0); } });