Looking to your code and the thing you want to be done, I would suggest first to make sure you understand the difference between.
$(linkID).attr(...)
and $("linkID").attr(...)
They are totally different things, until you get them cleared you will not be able to understand how this is fixed. jQuery documentation here might help you a bit.
and as far as the code is concerned, for the easiest fix use the following -
var linkID = this.id;
var theProp = $("#" + linkID).attr("href");
alert(linkID + "" + theProp);
or
var theProp = $(this).attr("href");
alert(theProp);