Toggling value 1 and 0 in javascript
<p>I want to send a value from js, if a button is clicked (for first time) send a value "1" to php file and again if it is clicked send a value "0" to the php file.</p>

<p>I am trying to do this way but it always alerts 0. Any help ? </p>

<pre><code>&lt;body&gt;
&lt;a href="#" onclick="countMe()"&gt;hello&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;script type="text/javascript"&gt;
function countMe() 
{
 var isClicked;
 var x = (isClicked=="0") ? "1" : "0"; 
 alert(x);
}
&lt;/script&gt;
</code></pre>
