# Show an element

Clear the hidden attribute and any inline display: none.

Canonical: https://1loc.dev/dom/show-an-element/
Version: 1.0.0
Runtime: JavaScript · modern browsers (DOM)
Verification: Usage lines executed in headless Chromium against the fixture markup; no external services
Updated: 2026-10-28

## Implementation

```javascript
function show(element) { element.hidden = false; element.style.removeProperty('display'); }
```

## Usage

Markup:

```html
<p id="notice" hidden>Saved</p>
```

Script:

```javascript
const notice = document.querySelector('#notice');
show(notice);
notice.checkVisibility(); // → true
```

Lines marked → were executed in headless Chromium against the markup above, and each result was compared with the value shown. Lines marked e.g. are illustrative.

## Limits

- If a stylesheet hides the element, it stays hidden; toggle a class instead.
- The original only cleared the inline display value, so an element hidden with the hidden attribute stayed hidden.

The function does not validate its arguments. Add checks where it receives untrusted input.

## Source and license

Original: https://github.com/phuocng/1loc/blob/14b481cf60dff1620ab1bb99a43b1f68068cdd9b/contents/show-an-element.mdx
Author: Nguyen Huu Phuoc and original contributors
Contributors: See original repository history
Source commit: 14b481cf60dff1620ab1bb99a43b1f68068cdd9b
Copyright (c) 2020 phuoc-ng
License: MIT — https://1loc.dev/licenses/
Maintainer: Oveyon
Modifications: Clears the hidden attribute as well as inline display: none. Executed in Chromium. Original MDX retained as inert source evidence.
