how to pass the variable value to href argument in anchor tag.
When your Javascript is executed, the a tag might not exist yet.
a
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