jquery get number from id
Your "id" values cannot be purely numeric; they need to start with a letter or "_" like an identifier. (Note: that's not true in HTML5 documents.) Once you've got a number in your "id" value like that, you would just use the jQuery attr()
function to get the id:
var theId = parseInt($('div.whatever').attr('id').replace(/[^\d]/g, ''), 10);