...

View Full Version : style.height issue...



jussa
10-13-2006, 03:20 PM
Hi all, i have the following function...


function ChangeTextboxSize(size) {

var objBox = document.getElementById("txtComment");
var curHeight = objBox.style.height;
alert(curHeight)

}

and it should return a height of 90px; as defined in my css, yet it returns an empty alert box...can someone enlighten me as to why??

Thanks, Justin

_Aerospace_Eng_
10-13-2006, 04:00 PM
Its doing exactly what it should. It would only return a value IF you used style="..." inside of that div. To get the css styles from the stylesheet you need to use the methods found here http://www.javascriptkit.com/dhtmltutors/dhtmlcascade.shtml

jussa
10-14-2006, 01:00 AM
awesome, thanks so much for the help!! :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum