If your javascript is in your Visualforce page you can simply use the same binding:
$('#Link').click(function(){
$("#iframe").attr("src", "/apex/mypage?id={!a.Id}");
}
Assuming that a
is available to the page (which it would appear to be so from the question).
If the code is not stored in the page directly, you could add a variable to the page:
<script type="text/javascript">
var accountId = "{!a.Id}";
</script>
And just use the variable accountId
in the code you're bringing in from elsewhere (note the check to see if it's actually defined):
$('#Link').click(function(){
var pageUrl = "/apex/mypage?id=" + (accountId ? accountId : "");
$("#iframe").attr("src", pageUrl);
}
Another alternative would be to put the value into a hidden field somewhere:
<apex:inputHidden value="{!a.Id}" id="theId"/>
and then use jQuery to pull that input's value inside your click function.