这是indexloc提供的服务,不要输入任何密码
Skip to content

Add examples for customizable select #11465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -54822,12 +54822,50 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
&hellip;</code></pre>
</div>

<div class="example" id="example-customizable-select">
<p>Here is an example which uses <code>div</code>, <code>legend</code>,
<code>img</code>, <code>button</code>, and <code>selectedcontent</code> elements:</p>

<pre><code class="html">&lt;select>
&lt;button>
&lt;selectedcontent>&lt;/selectedcontent>
&lt;/button>
&lt;div class="border">
&lt;optgroup>
&lt;legend>WHATWG Specifications&lt;/legend>
&lt;option>
&lt;img src="html.jpg" alt="">
HTML
&lt;/option>
&lt;option>
&lt;img src="dom.jpg" alt="">
DOM
&lt;/option>
&lt;/optgroup>
&lt;/div>
&lt;div class="border">
&lt;optgroup>
&lt;legend>W3C Specifications&lt;/legend>
&lt;option>
&lt;img src="forms.jpg" alt="">
CSS Form Control Styling
&lt;/option>
&lt;option>
&lt;img src="pseudo.jpg" alt="">
CSS Pseudo-Elements
&lt;/option>
&lt;optgroup>
&lt;/div>
&lt;/select></code></pre>
</div>

<p class="note" id="note-first-button-in-select-not-submit">The first child <code>button</code>
element as allowed by the content model of <code>select</code> is not a submit button. It is used
to replace the in-page rendering of the <code>select</code> element. Its form submission behavior
is prevented because it is <span>inert</span>.</p>



<h4>The <dfn element><code>datalist</code></dfn> element</h4>

<dl class="element">
Expand Down