这是我的形式控制高度和宽度客户端与JavaScript
<form action="#" enctype="multipart/form-data" method="post" name="..." id="formPhoto" class="fmp">
<input type="file" name="pho" id="photo" class="inph" accept="image/*">
<button type="submit" id="subFormPhoto" class="spp">press here</button>
</form>
,这是我的代码JS
<script type="text/javascript">
var inputPhoto= document.getElementById('photo');
inputPhoto.onchange=function(){var photo= this.value; photo.onload=function(){alert(this.width+' '+this.height);};};
</script>
我的问题是,不可视alert(this.width+' '+this.height);
。 好像没有加载photo
其中是id为'insPhotoAlert'的元素。你能否对你的问题更清楚些? –
对不起,我调整了。 – thorny84
我想查看inputPhoto的宽度和高度 – thorny84