title: Is there a way to pass a variable from jquery to javascript?
body: <pre><code>&lt;button type="button" class="metric"&gt;Metric&lt;/button&gt;
  &lt;button type="button" class="imperial"&gt;Imperial&lt;/button&gt;
  &lt;script&gt;
  jQuery(function($){
      $( '.metric' ).click(function(){
          count = 0;
      });
      $( '.imperial' ).click(function(){
          count = 1;  
      });
  });
  console.log(count);     
  &lt;/script&gt;
  </code></pre>
  
  <p>I am currently getting undefinded from my console. Is there a way to get the variable from jquery to vannila javascript?</p>