开发者

jquery applying css tag

开发者 https://www.devze.com 2023-01-01 20:52 出处:网络
$($(\"#myDiv\"开发者_C百科)).append(\"<b>Hello</b>\"); how can i apply to mydiv display:noneDon\'t manipulate the display CSS property with css(). Use hide():
$($("#myDiv"开发者_C百科)).append("<b>Hello</b>");

how can i apply to mydiv display:none


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

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

Why are you doing:

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

?


$("#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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号