get image height and width in file tag using javascript
<blockquote>
  <p><strong>Possible Duplicates:</strong><br>
  <a href="http://stackoverflow.com/questions/6633190/get-image-height-and-width-in-file-tag-javascript">get image height and width in file tag javascript</a><br>
  <a href="http://stackoverflow.com/questions/1310378/determining-image-file-size-dimensions-via-javascript">Determining image file size + dimensions via Javascript?</a><br>
  <a href="http://stackoverflow.com/questions/4094012/how-to-upload-preview-image-before-upload-through-javascript">How to upload preview image before upload through 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>
