Yes I've debugged and there's only one option element concerned ... I've tried many alternatives but it seems to always bug when applying .attr after .children - Is there any other way to select an option? Apart from using the id as $("#my_option").attr("selected", true) works fine -
Ben On Jul 3, 6:32 pm, "Ganeshji Marwaha" <[EMAIL PROTECTED]> wrote: > i am just wondering here.. did u try to debug and find out what element is > getting selected by jquery... are u getting an option element and only a > single option element.? > > -GTG > > On 7/3/07, benjaah <[EMAIL PROTECTED]> wrote: > > > > > Thanx Ganeshji I've tried to set the attribute to "selected" instead > > of true as you proposed, but it doesn't work any better. > > The javascript error is: "Could not set the selected property" > > > Ben > > > On Jul 2, 7:33 pm, "Ganeshji Marwaha" <[EMAIL PROTECTED]> wrote: > > > i am not sure if what i am telling is correct or wrong... but can u try > > > ("selected","selected") instead of ("selected", true); > > > > -GTG > > > > On 7/2/07, benjaah <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > > > I've got a page where I'm changing the options of a select box and > > > > setting the first one to be selected: > > > > $("#my_select :first-child").attr("selected", true); > > > > > It works perfectly with Firefox, Safari and IE7 but doesn't with IE6 ! > > > > I've also tried the following without success: > > > > $("#my_select").children(":first").attr("selected", true); > > > > $("#my_select :eq(0)").attr("selected", true); > > > > $("#my_select option:first").attr("selected", true); > > > > > I've also had the same bug using other selectors in "children" with > > > > IE6, > > > > like $("#my_select").children("[EMAIL > > > > PROTECTED]"+my_id+"]").attr("selected", > > > > true); > > > > > Has anyone experienced the same problem? > > > > Or am I doing something wrong? > > > > > Thanx for your help - > > > > > Ben