jQuery Google Maps get address based on click
<p>I am building a Google Maps feature. When the user clicks the button the jquery script should grab the address from the textbox but its not working properly. Does anybody know what all I am doing wrong?</p>

<pre><code>&lt;script type="text/javascript" src="http://code.jquery.com/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&amp;amp;language=en"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="&lt;?=base_url()?&gt;data/gmap3.js"&gt;&lt;/script&gt;

&lt;script&gt;
    $(document).ready(function() {
        function getAddress() {
            $("#addressClick").click(function() {
                $('#address').val();
            });
        }
        $("#my_map").gmap3({
            marker: {
                address: getAddress()
            }, map:{
                options:{
                    zoom: 14
                }
            }
        });
    });
&lt;/script&gt;
&lt;input id="address" type="text" placeholder="Please type in your address"&gt;&lt;input type="button" value="Go to location" id="addressClick"&gt;
&lt;div id="my_map" style=" height: 350px; width: 300px;"&gt;&lt;/div&gt;
</code></pre>
