I have some divs that have a css display of either ‘block’ or ‘none’ :
$("#divMTR").css("display", "none");
$("#divST").css("display", "block");
Is it possible to check what the css display value is for a div in JQuery? I would like to check what the value is, and on a certain condition change it.
You can get the value of a CSS proeprty by writing
$(...).css('propertyName').You may also want to write
if ($('#divST').is(':visible'))(or:hidden), using jQuery’s.is()method (which checks whether an element matches a selector) and the:visibleand:hiddenpseudo-selectors.