SetStyleByID function





6
Date Submitted Mon. Nov. 6th, 2006 9:24 AM
Revision 1 of 1
Scripter Casper42
Tags CSS | Style
Comments 1 comments
This function will set the style of an element by it's ID

function setStyleById(objId, objProperty, objValue) {
//  This function will apply a style to an Element based on Id
//  Works with IE and Mozilla based browsers
        var element = (ie) ? document.all(objId) : document.getElementById(objId);
        element.style[objProperty] = objValue
}
 

Jeremy Edmiston

Comments

Comments Only worked in IE7
Thu. Nov. 23rd, 2006 1:53 PM    Helper snowdonkey

Voting