UnderZ

Javascript Library.

Default CSS display for an element.

Get default css display value for element tag.


Get default display style

_z(selector).defaultDisplayStyle();

Returns: CSS Display Property String


Get default display style for element tag

_z().defaultDisplayStyle( tagname );

Returns: CSS Display Property String


Examples

<button id="textdg" style="display: grid;">Display grid</button>
<button id="textdf" style="display: flex;">Display flex</button>
<button id="textdib" style="display: inline-block;">Display inline block</button>

<script>
// bind click event to all buttons
_z("button").click(function () { 
	alert( _z(this).defaultDisplayStyle() ); // default button css display is: inline-block
});

// get default CSS display value for div
alert( _z().defaultDisplayStyle( "div" ) ); // default button css display is: block
</script>

Recommended: bind events in .ready() to execute the event when the document is fully loaded.