jquery visibility hidden code example

Example 1: CHECK IF element is hidden jquery

// Checks CSS content for display:[none|block], ignores visibility:[true|false]
$(element).is(":visible");

// The same works with hidden
$(element).is(":hidden");

Example 2: jquery visibility hidden show

$(".Deposit").css('visibility', 'visible');

Example 3: jquery is element hidden

// Checks css for display:[none|block], ignores visibility:[true|false]
$(element).is(":hidden");

Example 4: jquery set visibility

An even simpler way to do this is to use jQuery's toggleClass() method

CSS
.newClass{visibility: hidden}

HTML
<a href="#" class=trigger>Trigger Element </a>
<div class="hidden_element">Some Content</div>

JS
$(document).ready(function(){
    $(".trigger").click(function(){
        $(".hidden_element").toggleClass("newClass");
    });
});