On Oct 26, 5:27 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > following code works in Firefox, but not Safari, why? or just my > Safar? can anybody test it? Thanks. > A.C. > > $("#state [EMAIL PROTECTED]'KY']").attr("selected", "selected"); > > <select name="state" id="state"> > <option value="NY">New York</option> > <option value="AL">Alaska</option> > <option value="KY">Kentuky</option> > <option value="IA">IOWA</option> > > </select>
It looks like a similar issue has been discussed previously, but for IE6: http://groups.google.com/group/jquery-en/browse_thread/thread/4c0cf8bc2a295382/572c4b1c1c2548cd I confirmed that $("#state [EMAIL PROTECTED]'KY']").attr("selected", "selected"); does not work in Safari 3 (on windows), but I was able to get the following to work: $('#state option[value="KY"]')[0].selected = true; I put some alert statements in and when using the jQuery attr to set selected, and even though the value of option is set correctly, the UI doesn't get updated.