How do I set a visible property of a div element to true or false in jquery?

For the display CSS property, use .show(), .hide() or .toggle() to affect whether it displays, like this:

$(".panel").show();
//or to hide:
$(".panel").hide();
//toggle show/hide
$(".panel").toggle();
//or show/hide based on boolean:
$(".panel").toggle(bool);

For the visibility CSS property, you need to set it manually (jQuery is mostly built around display), using .css() like this:

$(".panel").css("visibility", "visible");
//or:
$(".panel").css({ visibility: "visible"});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)