Home  >  jQuery

Example of Checked Selector in jQuery

March 31, 2013
:checked selector works for checkbox and radio button. It selects those elements which are checked.

<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<input type="checkbox" value="A">
A
<input type="checkbox" value="B">
B
<input type="checkbox" value="C">
C

<script>
$( "input" ).on( "click", function() {
alert( $("input:checked").val() + " is checked!" );
});
</script>
</body>
</html>
 
FIND MORE TUTORILAS






©2019 concretepage.com | Privacy Policy | Contact Us