views:

490

answers:

1

In IE, using jQuery I set the height of a DIV nicely:

$('[id$=divBahai]')[0].style.height = 123;

The same code run in FireFox and Safari does not alter the height of the Div. I put an Alert() after the code to display what the style.height was and it was blank in FF and Safari. It came up as "123px" in IE and displayed right.

Is there a way to set the height of a div that is friendly to all of the browsers?

+4  A: 

Try this:

$('[id$=divBahai]:first').css('height','123px');
ichiban