title: How to create and use integer in jquery?
body: <p>I'm using jquery in a html project. I'm trying to make an integer that will change each time a button is pressed to count how many times it has been pressed and change the result.</p>
  
  <p>Here's pretty much the code i've written</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function(){
  int x = 0;
  $("#buttonid").click(function(){
      if(x == 0)
      {
         $("#text").fadeIn();
         $("#othertext").fadeOut();
      }
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>What am i doing wrong? i couldn't understand the documentation properly</p>