tags:

views:

46

answers:

2
$($("#myDiv")).append("<b>Hello</b>");

how can i apply to mydiv display:none

+2  A: 

$("#myDiv").css("display","none"); should do the trick but look into the jquery hide method too (hide) which can hide the div "smoothly" if you want that.

Chris Meek
+4  A: 

Don't manipulate the display CSS property with css(). Use hide():

$("#myDiv").hide().append("Hello");

Why are you doing:

$($("#myDiv"))...

?

cletus
it will also compressed the place it is using?
mazhar kaunain baig
Ok i will see to it also thanks
mazhar kaunain baig
@mazhar what do you mean by "compressed"?
cletus