CSS :default Selector (original) (raw)
Last Updated : 29 Aug, 2024
The :**default selector is used to set a default element in a group of same type of element in a form. This selector is used on button, option, radio button and check-box.
**Syntax:
:default {
//property
}
**Example:
HTML `
<h3>Select Language</h3>
<form action="">
<input type="checkbox" name="lan" value="c" checked> C
<br>
<input type="checkbox" name="lan" value="c++"> C++
<br>
<input type="checkbox" name="lan" value="java"> Java
<br>
<input type="checkbox" name="lan" value="c#"> C#
<br>
<input type="checkbox" name="lan" value="python"> Python
<br>
<input type="checkbox" name="lan" value="javascript"> JavaScript
<br>
</form>
`
**Output:
**Supported Browsers:
- Google Chrome 10.0
- Edge 79.0
- Firefox 4.0
- Safari 5.0
- Opera 10.0