JS not working properly
<p>Following JS is not working properly:</p>

<pre><code>document.getElementById("btn").value="harry";
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
}
else {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", url, false);
xmlhttp.send(null);
document.getElementById("btn").value="joy";
</code></pre>

<p>The default value of <code>btn</code> is <code>joy</code>. When I run this the value of <code>btn</code> is not changing. All other things are working fine.</p>

<p><em><strong>I want to see the value change to "harry" while ajax request is running.</em></strong></p>

<p>Why value is not changing? How to solve it?</p>

<p>HTML code:</p>

<pre><code>&lt;input id="btn" type="button" value="joy" onclick="change(id)" /&gt;
</code></pre>
