From the following markup.
Somewhere Somewher
If you know that all your ids are prefixed by "link-", you can simply get the substring of the id:
$("#my-div a").click(function(){ alert(this.id.substr(5)); });