how can i get the height and width of image without page refresh in file tag?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6633197/get-image-height-and-width-in-file-tag-using-javascript">get image height and width in file tag using javascript</a>  </p>
</blockquote>



<p>how can i get the height and width of image without page refresh in file tag?</p>

<pre><code>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;&lt;/TITLE&gt;
&lt;script language="javascript"&gt;
function getW(){

    var theImg = document.getElementById('testimg');

    alert(theImg.width);

}

function getH(){
    var theImg = document.getElementById('testimg');
    alert(theImg.height);
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;
&lt;input type="file" id="testimg"/&gt;
&lt;input type="button" value="get Width" onclick="getW()"/&gt;
&lt;input type="button" value="get Height" onclick="getH()"/&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre>

<p>i get the image height and width of image using php code, but that time page will be refreshed, without page refresh i get image size but not a height and width....</p>
