I have an embarrassingly simple question: How can I display an image at double its size without hard coding the width and height attributes? Here's what I tried, but I ended up having to just enter 1000 for width and height. Is something wrong with my function? Thanks!
<img onload="double(self.id);" name="bigPic" id="bigPic" src="album1.jpg" height="1000" width="1000"/>
function double(id) {
var img = document.getElementById(id);
var dblWdth = img.width * 2;
var dblHt = img.height * 2;
img.height = dblHt;
img.width = dblWdth;
}