Hi Jeff,

The slash ( / ) in your selector expression is finding children only, not descendants. Use either a space or two slashes to find all descendants. Also, jQuery has a pseudo-selector for checkboxes, :checkbox. So you could do this ...

        $("#checkGroup//:checkbox")

or this ...

        $("#checkGroup :checkbox")


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 2, 2007, at 11:28 PM, Mindblender wrote:


I am trying to get all of the check box elements within a div
element.  Some are also inside a span element within the div.  When I
do $("#checkGroup/[EMAIL PROTECTED]"), I get the first 5
checkboxes but the remaining 4, the ones within the span, aren't
included.  How can I select all of the check boxes regardless if they
are in a span or not?

Here is my html code:

<div id="checkGroup">
  <input type="checkbox" name="chk1" /> Option 1<br />
  <input type="checkbox" name="chk2" /> Option 2<br />
  <input type="checkbox" name="chk3" /> Option 3<br />
  <input type="checkbox" name="chk4" /> Option 4<br />
  <input type="checkbox" name="chk5" /> Option 5
  <span id="subGroup" style="margin-left: 40px;display: block;">
    <input type="checkbox" name="chk6"/> Option 6<br />
    <input type="checkbox" name="chk7"/> Option 7<br />
    <input type="checkbox" name="chk8"/> Option 8<br />
    <input type="checkbox" name="chk9"/> Option 9
  </span>
</div>

Any suggestions?

thanks,
Jeff


Reply via email to