Home >>jQuery Tutorial >jQuery checked Selector

jQuery checked Selector

jQuery checked Selector

jQuery checked selector in jQuery is used to selects all checked checkboxes or radio buttons.

Here is an Example of jQuery :checked Selector

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
$(":checked").wrap("<span style='background-color:lightgreen'>");
<form action="">
Name: <input type="text" name="user"><br>
selector 1: <input type="checkbox" name="vehicle" value="Bike"><br>
selector 2: <input type="checkbox" name="vehicle" value="Car" checked="checked"><br>
selector 3: <input type="checkbox" name="vehicle" value="Airplane"><br>
<input type="submit">

selector 1:
selector 2:
selector 3: