Reputation: 355
I have the below div structure,
<div id=gridRows">
<ul class = "itemRow">
<li> <input type="hidden" id="hford1" value="1" /> <input type="hidden" id="hfsce1" value="1" /> </li>
</ul>
<ul class = "itemRow">
<li> <input type="hidden" id="hford2" value="2" /><input type="hidden" id="hfsce2" value="2" /></li>
</ul>
<ul class = "itemRow">
<li> <input type="hidden" id="hford3" value="3" /><input type="hidden" id="hfsce3" value="3" /></li>
</ul>
<ul class = "itemRow">
<li> <input type="hidden" id="hford4" value="4" /><input type="hidden" id="hfsce4" value="4" /></li>
</ul>
</div>
How to iterate this and get the hiddenfield value of each row inside the loop? How can get both the hidden fields values
Upvotes: 0
Views: 455
Reputation: 3334
var ar = [];
$('#gridRows ul.itemRow li input').each(function() {
$ar.push($(this).val());
});
Upvotes: 2
Reputation: 2786
$('ul').each(function()
{
$(this).value; // This is your rel value
});
Upvotes: 0