You didn't say what the value of 'i' is. Can I assume that it is an integer
value 0, 1, or 2?

Also, why div.ex in your selector? I would think you'd want div.explanation
to match the class in the HTML.

-Mike

> From: bob
> 
> What is the best way to select
> class="explanation"?
> I have available array
> var idArray = ['yyyy', 'state','gender'];
> 
> I tried this
> jQuery('#'+idArray[i]+'Sector div.ex');
> and it did not work.
> 
> Note: I cannot use id inside of <div class="explanation"></div>
> 
> <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>
> 

Reply via email to