Re: Images and javascript
PT Exorcist:
"... i have declared it up there in the html code."
Your statements ... width="15" height="15" ... do not declare variables. They are attributes of the Image tag.
I'm not a JavaScript expert, but I think the only way you can change the Image attribute is by using the Dom attribute interface.
Someone else may have a better solution for you.
Re: Images and javascript
document.getElementsByName() returns a collection, therefore having just item.width wouldn't work. item[id] or item[0] might work. But why not just use document.getElementById()? I think something like this would work out:
Code:
function SizeMe(el)
{
var img = document.getElementById(el);
alert(img.width);
}
....
<img src="http://vbforums.com/images/misc/subscribed.gif" onload="SizeMe(this.id);" width="15" height="15" border="0" id="xxx">
Good luck;