Skip to content
hlaCk edited this page Dec 21, 2018 · 1 revision

Hide an element.

Hide any element.

Hide element

_z(selector).hide();

  • _z to access UnderZ library.
  • selector select element by the selector to hide. ( you can send DOM element or selector)
  • hide method/action name.

Returns: _z(selector) Object

To show an element: Show element

Examples

<button id="button">Button !</button>
<button id="buttonHide">Hide button</button>
<button id="buttonShow">Show button</button>

<script>
// bind click event by element id
_z("#buttonHide").click(function () { 
	// hide element
	_z("#button").hide();
});

// bind click event by element id
_z("#buttonShow").click(function () { 
	// show element
	_z("#button").show();
});

</script>

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

Clone this wiki locally