The <selectedcontent> element displays the contents of the currently selected <option> inside the first-child <button> of a <select>. It unlocks “customizable selects” where the closed button and the picker list can be styled separately.
The browser clones the selected option into <selectedcontent>. When the selection changes, that clone is replaced.
Limited availability.
Not Baseline. Support is still rolling out. Keep a usable plain <select> experience for other browsers.
Placement rule.
<button> must be the first child of <select>, and <selectedcontent> is the button’s child. Options follow the button.
Style: target the clone separately from picker options.
Support: limited — enhance progressively.
One line: put <selectedcontent> in the first-child button of <select> to style the closed face of customizable selects.
UA style
Default CSS Settings
Supporting browsers render the clone inside the button. Authors often add rules such as:
default.css
/* Example author CSS — hide bulky media in the closed button */
selectedcontent img {
display: none;
}
Exact UA defaults vary. Rely on progressive enhancement, not on a single engine’s look.
Frequently Asked Questions
selectedcontent lives inside the first-child button of a select and displays a clone of the currently selected option. It enables customizable selects where you style the closed button separately from the picker list.
No. It supports only the global HTML attributes. Behavior comes from its placement inside select > button.
As the (only) child of a button that is the first child of select. Options come after that button. Without this structure, browsers fall back to an implicit button you cannot target as selectedcontent.
The browser clones the selected option’s content into selectedcontent (via cloneNode). When the selection changes, the clone is replaced. Dynamic edits to an already-selected option after render may not sync automatically.
Content inside the select’s button — including selectedcontent — is inert by default. Users interact with the select control itself, not with focusable widgets inside the clone.
No. It has limited availability as part of customizable selects. Always provide a usable plain select fallback for unsupported browsers.