> From: bob
> 
> jQuery('#genderSector div.explanation');
> 
> did not work.

It works for me. I went to http://docs.jquery.com/ and entered this in the
multiline Firebug console:


$('body').append('<div id="yyyySector"> <input type="text" name="yyyy"
id="yyyy" value="" size="4" maxlength="4"> <div class="explanation"></div>
</div>  <div id="stateSector"> <select id="state" name="state"> <option
value=\'AL\'>Alabama</option> <option value=\'AK\'>Alaska</option> </select>
<div class="explanation"></div> </div>  <div id="genderSector"> <input
type="radio" name="f" id="f" value="1" />Female <input type="radio" name="m"
id="m" value="2" />Male <div class="explanation"></div> </div>');

jQuery('#genderSector div.explanation')


(The $('body')... should all be on one line for the long quoted string.)

This logged a single jQuery object with the expected content.

There must be something else going on in your test page that isn't apparent
from the code snippet. If it doesn't jump out at you, post a link to that
test page.

> Does not matter what value of i is. I just wanted to show 
> that it would be used in iteration.

I had a feeling that was the case, but when troubleshooting a code snippet
out of context, it pays to double-check my assumptions.

-Mike

Reply via email to