I use the code below to update the url link based on user text input:
<input type="text" id="q" />
<input type="button" id="submit" value="submit" />
<script>
$(function () {
$("#submit").click(function() {
var url = "/tag/";
url += $("#q").val();
window.location = url;
});
});
</script>
Right now it works pretty fine when someone clicks the submit button. What I want is to make it also work when a user press the enter button. Fiddle HERE