Usually you can trust the .toggle function (or .slideToggle) to hide or show whatever you want it to. But occasionally you need to know if something is hidden or shown.

var isVisible = $(‘#giftMsg’).is(‘:visible’);
var isHidden = $(‘#giftMsg’).is(‘:hidden’);

By Jason

One thought on “If an element is visible or hidden using jQuery”

Leave a Reply

Your email address will not be published. Required fields are marked *