画像の高さと幅
画像をクリックしたら画像の高さと幅が表示する。
<html> <head> <title>テスト</title> <script type="text/javascript"><!-- function test(picture_name) { var image = new Image(); image.src = picture_name; document.write(image.height + "<br>" + image.width); } // --></script> </head> <body> <img src="picture_1.jpg" width=50 height=50 onClick="test('picture_1.jpg')"> </body> </html>