JQuery syntax re select

supportoranges
supportoranges used Ask the Experts™
on
$('select > option').each(function()


Would somebody please explain how I'm supposed to interpret the  '>'  ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
> means a direct descendent of someething, e.g.

<div id='dog>
   <div id='cat'>
   text
    </div>
   <div id='cat2'>
   text
    </div>
</div>

so,

$("#dog>div").html("dddd");

would update both the cat and cat2 divs, which are children of dog

In your case, you probably have something like this:

<select id='question'>
   <option>one</option>
   <option>two</option>
   <option>three</option>
</select>

since <option> is a direct descendent of <select>, your selector would include all of the options in that particular select, but would not include any options outside of that select.

Author

Commented:
thank you soooooo much!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial