The problem you are facing is that all this block of code is executed in the DOM ready event.
var term = $('#term').val();is evaluated only once and saved "enter your search" in the term variable. That's why no matter what you change the value, the variable still retains the initial value when rendering the page.
Instead, you should do something more like the following:
JQuery
$(document).ready(function() {
$('#hit').click(function() {
alert($('#term').val());
});
});
id .