:indeterminate

  • Revision slug: CSS/:indeterminate
  • Revision title: :indeterminate
  • Revision id: 293581
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

Summary

The :indeterminate CSS pseudo-class represents any <input type="checkbox"> element whose indeterminate DOM property is set to true by JavaScript. In addition, in some browsers, it can be used to match to {{ HTMLElement("progress") }} elements in an indeterminate state.

Examples

W3C CSS3 Selectors test#177

<style>
       input, span { background: red }
       :indeterminate, :indeterminate + span { background: limegreen }
</style>

<p><input type=checkbox> <span>Everything in this paragraph should have a green background.</span></p>

<script> document.getElementsByTagName("input")[0].indeterminate = true; </script> 

Specifications

Specification Status Comment
{{ SpecName('HTML WHATWG', '#selector-indeterminate', ':valid') }} {{ Spec2('HTML WHATWG') }} No change.
{{ SpecName('HTML5 W3C', '#selector-indeterminate', ':valid') }} {{ Spec2('HTML5 W3C') }} Defines the semantic regarding HTML and constraint validation.
{{ SpecName('CSS4 Selectors', '#indeterminate', ':valid') }} {{ Spec2('CSS4 Selectors') }} No change.
{{ SpecName('CSS3 UI', '#indeterminate', ':valid') }} {{ Spec2('CSS3 UI') }} Defines the pseudo-class, but not the associated semantic.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
type="checkbox" {{ CompatVersionUnknown() }} {{ CompatGeckoDesktop("1.9.2") }} 9.0 10.60 (2.6) 3.0
{{ HTMLElement("progress") }} {{ CompatUnknown() }} {{ CompatGeckoDesktop("6.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
type="checkbox" {{ CompatUnknown() }} {{ CompatGeckoMobile("1.9.2") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
{{ HTMLElement("progress") }} {{ CompatUnknown() }} {{ CompatGeckoDesktop("6.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

See also

Revision Source

<p>{{ CSSRef() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>:indeterminate</code> CSS <a href="/en/CSS/Pseudo-classes" title="en/CSS/Pseudo-classes">pseudo-class</a> represents any <code>&lt;input type="checkbox"&gt;</code> element whose <code>indeterminate</code> DOM property is set to <code>true</code> by JavaScript. In addition, in some browsers, it can be used to match to {{ HTMLElement("progress") }}&nbsp;elements in an indeterminate state.</p>
<h2 id="Examples">Examples</h2>
<p><a class="external" href="http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/full/flat/css3-modsel-d5.html" title="http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/full/flat/css3-modsel-d5.html">W3C CSS3 Selectors test#177</a></p>
<pre class="brush: css">
&lt;style&gt;
       input, span { background: red }
       :indeterminate, :indeterminate + span { background: limegreen }
&lt;/style&gt;

&lt;p&gt;&lt;input type=checkbox&gt; &lt;span&gt;Everything in this paragraph should have a green background.&lt;/span&gt;&lt;/p&gt;

&lt;script&gt; document.getElementsByTagName("input")[0].indeterminate = true; &lt;/script&gt;&nbsp;</pre>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('HTML WHATWG', '#selector-indeterminate', ':valid') }}</td>
      <td>{{ Spec2('HTML WHATWG') }}</td>
      <td>No change.</td>
    </tr>
    <tr>
      <td>{{ SpecName('HTML5 W3C', '#selector-indeterminate', ':valid') }}</td>
      <td>{{ Spec2('HTML5 W3C') }}</td>
      <td>Defines the semantic regarding HTML and constraint validation.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSS4 Selectors', '#indeterminate', ':valid') }}</td>
      <td>{{ Spec2('CSS4 Selectors') }}</td>
      <td>No change.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSS3 UI', '#indeterminate', ':valid') }}</td>
      <td>{{ Spec2('CSS3 UI') }}</td>
      <td>Defines the pseudo-class, but not the associated semantic.</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td><code><span>type="checkbox"</span></code></td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatGeckoDesktop("1.9.2") }}</td>
        <td>9.0</td>
        <td>10.60 (2.6)</td>
        <td>3.0</td>
      </tr>
      <tr>
        <td>{{ HTMLElement("progress") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoDesktop("6.0") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td><code><span>type="checkbox"</span></code></td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoMobile("1.9.2") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
      <tr>
        <td>{{ HTMLElement("progress") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoDesktop("6.0") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li><a class="internal" href="/web-tech/2009/02/05/a-new-checkbox-type" title="web-tech/2009/02/05/a-new-checkbox-type">Web Tech Blog - A new checkbox type</a></li>
</ul>
Revert to this revision