How can I change CSS display none or block property using jQuery?

DEVOPS picture DEVOPS · Aug 27, 2010 · Viewed 1.4M times · Source

How can I change CSS display none or block property using jQuery?

Answer

djdd87 picture djdd87 · Aug 27, 2010

The correct way to do this is to use show and hide:

$('#id').hide();
$('#id').show();

An alternate way is to use the jQuery css method:

$("#id").css("display", "none");
$("#id").css("display", "block");