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.
Here's pretty much the code i've written
<script>
$(document).ready(function(){
int x = 0;
$("#buttonid").click(function(){
if(x == 0)
{
$("#text").fadeIn();
$("#othertext").fadeOut();
}
});
});
</script>
What am i doing wrong? i couldn't understand the documentation properly