Assuming #xxx is your input container identifier, your code should work:
<div id="xxx" align="center">
<input name="test" value="/images/image1.jpg" />
</div>
Update for Chrome
<script type="text/javascript">
var newImg = new Image();
$(function() {
var v = $('#xxx input').val();
alert(v);
newImg.src = v;
setTimeout(function() {
var height = newImg.height;
var width = newImg.width;
alert ('The image size is '+width+'*'+height);
}, 1000);
});
</script>
source
share