日期:2014-05-17 浏览次数:20863 次
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <script> function test(){ var img2=document.getElementById('img1'); alert('图片大小为'+parseInt(img2.fileSize/1024)+'K');//大小,你测试看看! } </script> </head> <body> <img src="1.jpg" id="img1"/> <input type="button" onclick="test();" value="测试"/> </body> </html>