[jQuery] Re: super easy jquery question

2009-12-01 Thread MorningZ
> > // reset select > > $('#form_id select').each(function(){ > > $(this).find('option:first').attr('selected', 'selected').parent('select'); > > }); Yuck, what a waste of energy document.getElementById("form_id").selectedIndex = 0; would do the same exact thing

[jQuery] Re: super easy jquery question

2009-12-01 Thread mike
Thanks to both! Mike On Dec 1, 12:22 am, HS8KIC wrote: > you can do this. > // reset input type text > $('#form_id input[type=text]').each(function(){ this.value = ''; }); > // reset textarea > $(''#form_id textarea').each(function(){ this.value = ''; }); > // reset select > $('#form_id select')