I have something like this:
<div id="row1">Some content</div>
<div id="row2">Some content</div>
<div id="row3">Some content</div>
<div id="row4">Some content</div>
<div id="row7">Some content</div>
<div id="row15">Some content</div>
<div id="row915">Some content</div>
<div id="row919">Some content</div>
Rows are actually pulled from PHP array and now I need to extract last row’s number e.g. in this case that would be 919. (so I can add +1 to row id when I use append to generate more rows via jQuery)…. Any ideas ?
If you cant do what Jon have suggested you can try this:
Here is an example fiddle: http://jsfiddle.net/HTkkb/
The script above finds the maximum number for postfix of all div’s ids and gets the element with id
row + max