defaultopen

Causes a pop-up to automatically open on page load.

Published on Updated on

The defaultopen global attribute is a boolean attribute that causes a pop-up to automatically open on page load.

It can be used on any HTML element that has been turned into a pop-up using the popover attribute.

Values

The attribute can have any of the following values:

false (default value)
The pop-up does not open on page load.
none or true
The pop-up opens on page load.

Example

<p id="my-popup" popover="auto" defaultopen>Hello!</p>

Browser compatibility

See also

Updated on Improve article

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.