Images in Javascript

From Code Trash
Jump to: navigation, search

Reset width and height of an image tag in javascript

var so = document.getElementById('imgid');
so.src = '';
so.style.width = 'auto';
so.style.height = 'auto';
//and then set the new width and height or just skip it...
so.src = 'path';

...

Reference: http://forums.asp.net/t/1151517.aspx