Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1000 Once an image has loaded how can I display its width and height beneath the image?

irt.org | Knowledge Base | DHTML | Q1000 [ previous next ]

Q1000 Once an image has loaded how can I display its width and height beneath the image?

Try:

<script language="JavaScript"><!--
function update(what) {
    document.myForm.width.value = what.width;
    document.myForm.height.value = what.height;
}
//--></script>

<img src="image.gif" onLoad="update(this)">

<form name="myForm">
<input type="text" name="width">
<input type="text" name="height">
</form>

Feedback on 'Q1000 Once an image has loaded how can I display its width and height beneath the image?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.