So I want to get the last Id of a div and then convert it into a variable
<div class="margin_bot" id="itemRows2">
<p id="rowNum1">...</p>
<p id="rowNum2">...</p>
<p id="rowNum3">...</p>
<p id="rowNum4">...</p>
<p id="rowNum5">...</p>
<p id="rowNum6">...</p>
</div>
So I know you can get the last id in a div with:
$('#itemRows2').children().last().attr('id');
Which returns "rowNum6"
so my question is how can I grab just the number 6
and put it into a var like var row1Num
in Jquery?