How to get Height and Width of an image using java script :client side validation

      Validate Image height and width before uploading

   <script language="javascript">

        function getWidth()


            var testImage = document.getElementById('testImage');



        function getHeight()


            var testImage = document.getElementById('testImage');




// HTML code



        <input type="file" id="testImage" value="browse"/>

        <input type="button" value="get Width" onclick="getWidth()"/>

        <input type="button" value="get Height" onclick="getHeight()"/>



Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Session timeout interceptor in struts 2