HTML code:
How can I get number \"45\" of string using jQuery?
You don't need (or particularly want) jQuery for this (it's very useful for lots of other things, just not particularly for this). Straight JavaScript and DOM:
var div = document.getElementById('block-id-45');
var n = div.id.lastIndexOf('-');
var target = div.id.substring(n + 1);
Live example: http://jsbin.com/osozu
If you're already using jQuery, you can replace the first line with:
var div = $('#block-id-45')[0];
...but there's little if any reason to.