how to pass the variable value to href argument in anchor tag.
You're missing the # for the id. Try using $('#a_tag_id'). Use an ? before your first query string variable instead of &.
Modify the jquery like this
$('#a_tag_id').attr('href','http://www.google.com&jobid='+id);
When your Javascript is executed, the a tag might not exist yet.
Use:
$(document).ready(function(){
var id = "10";
$('#a_tag_id').attr('href','http://www.google.com&jobid='+id);
});
Also, it should be #a_tag_id to match the id.
$('#a_tag_id').attr('href','http://www.google.com?jobid='+id);
The selector should be for id '#', and the querystring starts with "?".
BTW: Isn't this question following up on your last question: Pass an id to anchor tag ?
Use # for id selctor
$('#a_tag_id').attr('href','http://www.google.com&jobid='+id);
^
Fiddle Demo
You have miss # in jQuery selector, and insert the code inside the document.ready to make that your script work when the page is ready
Try this:
<script>
$(document).ready(function(){
var id = "10";
$('#a_tag_id').attr('href','http://www.google.com&jobid='+id);
});
</script>
DEMO