Make DIVs the same height

dextermorgan used Ask the Experts™
I have 2 divs - both with the same class that gives them a min-height. What i want to do is to use javascript/jquery to check the height of DIV B and change the min height in the class.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

document.getElementById('divb').style.height = document.getElementById('diva').style.height;

divb, diva are id's of the div's

if there is a class 'divclass' which has the min-height property, then following code will change a property of a class.

setClassStyle( 0, "divclass", "min-height", document.getElementById("divB").height);
function setClassStyle(s_s,classname,class_style,style_valu e)
	var style_sheet=document.styleSheets[s_s];
	for (var j=style_sheet.rules.length-1;j>=0;j--)
		var sS=style_sheet.rules[j];
		var class_name=sS.selectorText.replace(/\./g,'');
			return 0;

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial