I am attempting to identify the CSS property display
of a div. If it is set to display:block
, I want to change the icon to -
. If it is set to display:none
, I want to change the icon to +
.
I have tried using the following code but it does not seem to work:
if($('#ceo').css('display') == 'none'){
$("#button img").css({top:"-18px"});
} else {
$("#button img").css({top:"9px"});
}
My goal is to create a collapsible tree structure. Here is my Fiddle