$(document).ready(function() { $('#button-id').click(function() { foo($('#valuation_address').val()); }); });