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
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
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.
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
>
>
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
5 matches
Mail list logo