:checked - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:checked

Description

The :checked selector selects checked <input> radio buttons and checkboxes element and <option> element.

Example

The following code shows how to select checked <option> elements.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
option:checked {<!--   w w w . ja v a 2s.  com-->
    height: 100px;
    width: 100px;
}
</style>
</head>
<body>

<select>
  <option value="css">CSS</option>
  <option value="html">HTML</option>
  <option value="java">Java</option>
  <option value="sql">SQL</option>
</select>

</body>
</html>

Related Tutorials