How to Change an image’s width dynamically from Javascript

How to Change an image’s width dynamically from Javascript. Using DOM we can do this.

function changeImgSize(objectId,newWidth,newHeight) {
imgString = 'theImg = document.getElementById("'+objectId+'")';
oldWidth = theImg.width;
oldHeight = theImg.height;
theImg.width = newWidth;
theImg.height = newHeight;

Note: this one i found on the web but i can’t remember where i found. Credits to the author.

The ‘alt’ property does not work with mozilla/firefox

The correct property to use for tooltips is title. The ‘alt’ property has a very important purpose, which is to provide replacement text for images in browsers that cannot or do not (by user’s choice) display images, and if graphical browsers display them as tooltips people will be discouraged from using them for their correct purpose.

for more info

Want to apply more than one style to an element?

If you want to apply styles that are defined as more than on style in your css, and you want to apply two or three of them combined and applied to a new elt of you html page ?
simply use like this.
class=”infobox smallGreyCaptionLight”
if u give class=”infobox; smallGreyCaptionLight” then the last style only will be applied. avoid semicolon in between the style names to apply the both