$(document).ready(function () { $('.recover').click(function (e) { var id = $('#Username').val(); //Replace the predefined QueryString param "xxx" with the "id" this.href = this.href + '?username=' + id; }); });