Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. [CSS Selector] E:checked

[CSS Selector] E:checked

'selector:checked' applies styles to elements that are checked, and is commonly referred to as a 'state pseudo-class'. It does not work in IE8 and earlier.

Since it applies to checked elements, it is mainly used with '' (checkboxes) or '' (radio buttons).

Sample Code

input:checked + p { color: red;} /* Makes the sibling p element red when checked. */

Browser Preview

input:checked + p { color: red;} /* Makes the sibling p element red when checked. */

<input type="checkbox">
<p>Color changes when checked.</p>
<input type="radio">
<p>Color changes when checked.</p>

Browser Support

Chrome Chrome
1+
Firefox Firefox
1+
Safari Safari
3.1+
2 and earlier ×
Edge Edge
12+
Supported in all versions
IE IE
11
10
9
8 ×
7 ×
6 ×
Opera Opera
9+
8 and earlier ×
iOS Safari iOS Safari
2+
1 and earlier ×
Android Android Browser
2+
Chrome Android Chrome Android
Latest
Same support as desktop
Firefox Android Firefox Android
Latest
Same support as desktop

※ Version data based on MDN.

If you find any errors or copyright issues, please .