Elements show() - KirkGarcia182/domExtend GitHub Wiki

show()

Description

Changes the elements display depending on the passed parameter. If no parameter was passed then it will change the element's display to inherit

Syntax

element.show([display])

Parameters

display (Optional) - A String that represents what the display value of the element is.

Return Value

The element you just manipulated so you can chain these methods.

Example

<!DOCTYPE html>
<html>
<head>
	<title>domExt Examples</title>
</head>
<body>
	<div id="app">
		<div class="menus">
			<ul id='menuList'>
				<li><a class='menuLink'>Menu 1</a></li>
				<li><a class='menuLink'>Menu 2</a></li>
				<li><a class='menuLink'>Menu 3</a></li>
			</ul>
		</div>
	</div>
	<script type="text/javascript" src="domExt.js"></script>
	<script type="text/javascript">
		window.$ = document;

		let app = $.byId('app');
		app.hide();

		app.show();
		console.log(app);
		/* Result
			<div id='app' style='display: inherit'>
		*/

		app.hide();
		app.show('inline-block');
		console.log(app);
		/* Result
			<div id='app' style='display: inline-block'>
		*/
	</script>
</body>
</html>
⚠️ **GitHub.com Fallback** ⚠️