how to get value dynamically in jquery?
<pre><code>&lt;table &gt;
&lt;tr align="left" id="progNav" class="width_150 margin_top20"&gt;


                    &lt;core:forEach items="${fields}" var="field" &gt;
                      &lt;th value="${field.id} .." &lt;core:if test="${field.id == fieldId }"&gt;id="bg_active_1" class="selected" &lt;/core:if&gt;&gt;&lt;a href="" class="bg_link1"&gt;${field.programmeField}&lt;/a&gt;&lt;/th&gt;
                     &lt;/core:forEach&gt;        

&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>How to get value for class="selected" or id="bg_active_1" ?
List
i have tried this :-</p>

<pre><code>var fieldId=$('#progNav').parent().find('#bg_active_1').val();
var fieldId=$('#progNav').parent().find('th.selected').val();
var fieldId=$("#bg_active_1").val();
</code></pre>

<p>and many more but dont know why i every time get empty value ! i got muddled headed please help me out.</p>
