[jQuery] Re: Set select menu with current day

2009-02-23 Thread Liam Potter
Your welcome, though I noticed something wrong...this should be a bit better $("select").children("option").each(function() { if ( $(this).html() == varDay ) { $(this).attr("selected","selected"); } }); Nic Hubbard wrote: Perfect! Thank you! On Feb 22, 1:34

[jQuery] Re: Set select menu with current day

2009-02-22 Thread Nic Hubbard
Perfect! Thank you! On Feb 22, 1:34 pm, Liam Potter wrote: > oh ok, same idea then I assume the days are displayed as numbers > > $("select").children("option").each(function() { >         if ( $("select").children("option").html() == varDay ) { >                 $(this).attr("selected","selec

[jQuery] Re: Set select menu with current day

2009-02-22 Thread Liam Potter
oh ok, same idea then I assume the days are displayed as numbers $("select").children("option").each(function() { if ( $("select").children("option").html() == varDay ) { $(this).attr("selected","selected"); } }); Nic Hubbard wrote: I am not needing a class.

[jQuery] Re: Set select menu with current day

2009-02-22 Thread Nic Hubbard
I am not needing a class. This is a select input menu, that has options for 1-31. I need to have the correct option set as the selection option, based on what day it currently is. On Feb 22, 1:12 pm, Liam Potter wrote: > put id's on the days of the month eg id="day1" > > then you could do > >

[jQuery] Re: Set select menu with current day

2009-02-22 Thread Liam Potter
put id's on the days of the month eg id="day1" then you could do $("day"+dayVar"").addClass("activeclass"); Nic Hubbard wrote: I have a var that gets set with the current day, so, today would be 22. Then, I have a select menu with all the days of the month. How could I set the selected ite