I have a bunch of elements like:
..
I want to loop through all of them and get the highest
I think you need the second value the splitted ID, and you might want to convert the string to an integer, like this:
var newid = 0; $(".blah").each(function() { var id = parseInt( this.id.split('-')[1], 10 ); if( id > newid) newid = id; });