:indeterminate

  • Revision slug: CSS/:indeterminate
  • Revision title: :indeterminate
  • Revision id: 41049
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment one or more formatting changes

Revision Content

{{ CSSRef() }}{{ gecko_minversion_header("1.9.2") }}

Summary

The :indeterminate CSS pseudo-class matches <input type="checkbox"> elements whose indeterminate DOM attribute is set to true by JavaScript.

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>

Browser compatibility

Browser Lowest version
Internet Explorer ---
Firefox (Gecko) 3.6 (1.9.2)
Opera (Presto) 10.60 (2.6)
Safari (WebKit) 3.0 (522)

Specifications

See also

Revision Source

<p>{{ CSSRef() }}{{ gecko_minversion_header("1.9.2") }}</p>
<h3>Summary</h3>
<p>The<code> :indeterminate </code>CSS <a href="/en/CSS/Pseudo-classes" title="en/CSS/Pseudo-classes">pseudo-class</a> matches<code> &lt;input type="checkbox"&gt; </code>elements whose<code> indeterminate </code>DOM attribute is set to<code> true </code>by JavaScript.</p>
<h3>Examples</h3>
<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>&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;
</pre>
<h3>Browser compatibility</h3>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest version</th> </tr> <tr> <td>Internet Explorer</td> <td>---</td> </tr> <tr> <td>Firefox (Gecko)</td> <td>3.6 (1.9.2)</td> </tr> <tr> <td>Opera (Presto)</td> <td>10.60 (2.6)</td> </tr> <tr> <td>Safari (WebKit)</td> <td>3.0 (522)</td> </tr> </tbody>
</table>
<h3>Specifications</h3>
<ul> <li><a class="external" href="http://www.w3.org/TR/css3-selectors/#indeterminate" rel="external
    nofollow" target="_blank" title="http://www.w3.org/TR/css3-selectors/#indeterminate">CSS 3 Selectors #indeterminate</a> Working draft</li> <li><a class="external" href="http://www.w3.org/TR/html5/interactive-elements.html#selector-indeterminate" title="http://www.w3.org/TR/html5/interactive-elements.html#selector-indeterminate">HTML 5 Interactive elements #selector-indeterminate</a></li> <li><a class="external" href="http://www.w3.org/TR/html5/forms.html#checkbox-state" title="http://www.w3.org/TR/html5/forms.html#checkbox-state">HTML 5 Forms #checkbox-state</a></li>
</ul>
<h3>See also</h3>
<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