You need to find the option, not the select. var monthVar = from the server or wherever; $("#intended_start_month option[value=" + monthVar + "]").attr("selected", "selected");
Glen On 9/30/07, voltron <[EMAIL PROTECTED]> wrote: > > > Hi all, how would select an option and set its attribute to selected? > I have this part already : > > $("#intended_start_month").attr("selected", "selected"); > > > > This is the HTML, I want so make a particular month selected when the > page loads > > <select id="intended_start_month" name="intended_start_month"> > <option value="january"> Januar</option> > <option value="february"> Februar</option> > ----- and so on..... > > > Thanks > >