Category: jQuery Questions

jQuery Challenge #1 – Toggle Multiple Checkboxes

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <input type="checkbox" name="all" id="all" value="all"> <label for="all">All</label> <input type="checkbox" name="apple" id="apple" value="apple"> <label for="apple">Apple</label> <input type="checkbox" name="orange" id="orange" value="orange"> <label for="orange">Orange</label> <input type="checkbox" name="mango" id="mango" value="mango"> <label for="mango">Mango</label> <input type="checkbox" name="grapes" id="grapes" value="grapes"> <label for="grapes">Grapes</label> <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="

How to Uncheck a Radio Button Using jQuery

To uncheck a radio button in jQuery, we make use of prop() function.  This function is only available in jQuery 1.6 or higher.  For jQuery 1.5 or lower, please make use of attr() function.  Example is given below for jQuery 1.6 or higher. <!DOCTYPE html> <html> <head> <title>jQuery Tutorial </title> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> //Function

How to Check a Radio Button Using jQuery

To check a radio button in jQuery, we make use of prop() function.  This function is only available in jQuery 1.6 or higher.  For jQuery 1.5 or lower, please make use of attr() function.  Example is given below for jQuery 1.6 or higher. <!DOCTYPE html> <html> <head> <title>jQuery Tutorial </title> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> //Function

How to Uncheck All Checkboxes Using jQuery

To ubcheck all checkboxes in jQuery, we make use of prop() function with attribute value selector.  This function is only available in jQuery 1.6 or higher.  For jQuery 1.5 or lower, please make use of attr() function.  Example is given below for jQuery 1.6 or higher. <!DOCTYPE html> <html> <head> <title>jQuery Tutorial </title> <script src="http://code.jquery.com/jquery-latest.js"></script>