Finds all checkbox inputs. using jquery
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" );
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
HTML Code :
JavaScript Code :