How to change css display none or block property using Jquery?
+4
A:
Use the jQuery css method:
$("#id").css("display", "none");
$("#id").css("display", "block");
GenericTypeTea
2010-08-27 08:53:31
Thank you for your replay ;-)
learner
2010-08-27 09:06:03
+2
A:
If the display of the div is block by default, you can just use .show()
and .hide()
, or even simpler, .toggle()
to toggle between visibility.
reko_t
2010-08-27 08:54:55
True, it will set display to whatever it was initially, which could be block or something different.
danielgwood
2010-08-27 08:56:35