Q:

Finds all checkbox inputs using jquery

0

Finds all checkbox inputs.  using jquery

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

HTML Code :

<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-git.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Finds all checkbox inputs.</title>
</head>
<body>
<form>
<input type="button" value="Input Button">
<input type="checkbox">
<input type="checkbox">
<input type="hidden">
<input type="button" value="Output Button">
<select>
<option>Option</option>
</select>
</form>
<p></p>
</body>
</html>

JavaScript Code :

var input = $( "form input:checkbox" )
.wrap( "" )
.parent()
.css({
background: "black",
border: "2px red solid"
});
$( "p" )
.text( "No. of checkbox: " + input.length)
.css( "color", "blue" );

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now