title: Get variable value from one JS function to another
body: <p>In my page I get user fb_id in one of function <code>function1()</code> when user perform login action.</p>
  
  <p>Later when user click on some button another function call takes place which calls <code>function2()</code>. I want to fetch value of <code>fb_id</code> in <code>function2()</code>. 
  How can i do it?</p>
  
  <p>structure is like below:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt; 
  function fuction2()
  {
  // some process
  var id = fb_it; // Getting fb_it from function1()
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script&gt;
  function function1()
  {
      var fb_it='xyz';
  }
  &lt;/script&gt;
  
  &lt;button type="submit" onclick="function2()"&gt; GetID &lt;/button&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Is it possible or not? If yes then how?</p>
  
  <p></p>