UPDATED: in responce to your comment:
if you want assign a variable outside the click event you can do this:
$(function () {
// declare the variable.. this one will hold the parent id
var my_value;
// now the click event...
$("#Grid1").click(function(e) {
e.preventDefault();
// my_value now is setted outside...
my_value = $(this).parent().attr("id");
});
// now for the example we observe the click event you can use it in other way!
$('#Grid1').bind( 'click' , function() {
// now as you can see we are using my_value that come from outside!
$('#showgrid').load('/Names/Friends/satish/' + my_value );
});
});
ADDITIONAL NOTE
now i don't know if the #Grid1 is inside the #showgrid but if this is the case, you need to use the live() method!
like this:
$("#Grid1").live( 'click' , function(e) {
// do something here as above...!
});
assuming:
<div id="this_is_parent_of_Grid1">
<a id="Grid1" href="">click</a>
</div>
OR if you use table
<table><tr>
<td id="this_is_parent_of_Grid1"><a id="Grid1">click</a></td>
</tr></table>