Maybe the eq() selecor would help more (http://docs.jquery.com/ Selectors/eq)
something like: $("#mylist option:eq(2), #mylist option:eq(0), #mylist option:eq (4)").attr("selected", "selected"); On Aug 3, 2:51 pm, shaded <dar...@eztransition.com> wrote: > Not exactly. I guess looping through my string would work. but its a > multiple select list so .addclass wont work > > i tried using > $("#mylist option:contains(3)").attr("selected", "selected"); > > this compares against the list value, not the id. Is there a way to > compare against the id? > > Better yet, us there a function that will let me drop in my string and > will simply find all the ids that match and then i can use .attr > ("selected", "selected"); on that?