Skip to content

Function: hide()

Overload 1

hide(element): void

Defined in: dom.ts:244

Hides the given element by setting the hidden attribute.

Parameters

element

HTMLElement

The target element.

Returns

void

Example

ts
// HTML
<p id="message">Hello!</p>
// JS
const el = facile.getElement('#message');
facile.hide(el);

Overload 2

hide<K>(tag): void

Defined in: dom.ts:256

Hides the first element matching the given tag name by setting the hidden attribute. Does nothing if no element is found.

Type Parameters

K

K extends keyof HTMLElementTagNameMap

Parameters

tag

K

The HTML tag name to search for.

Returns

void

Example

ts
// HTML
<p>Hello!</p>
// JS
facile.hide('p');

Overload 3

hide(selector): void

Defined in: dom.ts:268

Hides the first element matching the given CSS selector by setting the hidden attribute. Does nothing if no element is found.

Parameters

selector

string

A CSS selector string.

Returns

void

Example

ts
// HTML
<p id="message">Hello!</p>
// JS
facile.hide('#message');