Revision 41050 of :indeterminate

  • Revision slug: CSS/:indeterminate
  • Revision title: :indeterminate
  • Revision id: 41050
  • Created:
  • Creator: junger
  • Is current revision? No
  • Comment 1 words added, 1 words removed

Revision Content

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


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


W3C CSS3 Selectors test#177

       input, span { background: red }
       :indeterminate, :indeterminate + span { background: limegreen }

<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 9.0
Firefox (Gecko) 3.6 (1.9.2)
Opera (Presto) 10.60 (2.6)
Safari (WebKit) 3.0 (522)


See also

Revision Source

<p>{{ CSSRef() }}{{ gecko_minversion_header("1.9.2") }}</p>
<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>
<p><a class="external" href="" title="">W3C CSS3 Selectors test#177</a></p>
       input, span { background: red }
       :indeterminate, :indeterminate + span { background: limegreen }

&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;
<h3>Browser compatibility</h3>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest version</th> </tr> <tr> <td>Internet Explorer</td> <td>9.0</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>
<ul> <li><a class="external" href="" rel="external
    nofollow" target="_blank" title="">CSS 3 Selectors #indeterminate</a> Working draft</li> <li><a class="external" href="" title="">HTML 5 Interactive elements #selector-indeterminate</a></li> <li><a class="external" href="" title="">HTML 5 Forms #checkbox-state</a></li>
<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>
Revert to this revision