title: jquery onclick setting variable
body: <p>I set a variable 'api_key' on document load. I want to modify this variable with the text of an input field after clicking a button</p>
  
  <pre><code>var api_key = "";
  
  //my button has an id named "btn-verify", the input field has an id named "verify"
  $("#btn-verify").click({
          api_key = $("#verify").val();
  
      });
  </code></pre>
  
  <p>this doesn't work, how should I fix this. How do I assign api_key to the value of the input field, on click of a button</p>