title: How do I access this variable without a global?
body: <p>I'm trying to figure out how to make this work.</p>
  
  <pre><code>function foo(a) {
    $('#this-button').show();
  }
  
  function buttonClicked() {
    //get access to var a
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;button id="this-button" onclick="buttonClicked();"&gt;
  </code></pre>
  
  <p>This is a simplified version of what I have but the idea is the same.</p>
  
  <p>foo takes a variable, and then makes a button visible.  When the button is clicked, I want to do more things with var a.</p>
  
  <p>So like wait until the button is clicked to continue the function?</p>
  
  <p>Can't seem to figure it out.</p>
  
  <p>Thanks</p>