I-M-JM
I-M-JM

Reputation: 15950

jQuery setting height, width dynamically

I need to change height and width of a <div> using jQuery

I tried following code

jQuery('#chart_popup').css('height','600px');
jQuery('#chart_popup').css('width','450px');

I need this to be done in one statement, any suggestion?

Thanks.

Upvotes: 1

Views: 252

Answers (2)

ashish.chotalia
ashish.chotalia

Reputation: 3746

jQuery('#chart_popup').css( {width : '30px', height : '10px'} )

Upvotes: 3

Fenton
Fenton

Reputation: 250922

You can do it in one hit like this...

jQuery('#chart_popup').css({height: "600px", width: "450px"});

Upvotes: 2

Related Questions