Long ago, I needed to grab a text field value when the mouse is click on a button. Here you go:
<input type="text" value="hello value" id="hello" /> <input type="button" value="world value" id="world" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $("#world").click(function() { var value_grabed = $("#hello").val(); alert( value_grabed ); }) </script>