Return to Snippet

Revision: 17969
at September 18, 2009 06:28 by jodm


Initial Code
function getStyle(el,styleProp) {
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
}

Initial URL
http://www.quirksmode.org/dom/getstyles.html

Initial Description


Initial Title
Javascript getstyles

Initial Tags


Initial Language
JavaScript