Javascript Library.
Commands 0 |
---|
Get default css display value for element tag.
_z(selector).defaultDisplayStyle();
Returns: CSS Display Property String
_z().defaultDisplayStyle( tagname );
Returns: CSS Display Property String
<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.