(De)selecting All Checkboxes Using Dedicated Links - J Query

Problem
You need to select all checkboxes and deselect all checkboxes using dedicated Select All and Deselect All links:

Solution

Target the Select All and Deselect All links directly using their class attributes. Then attach the appropriate .click() handler:

Discussion

What will happen when JavaScript is disabled? You should hide the links by default in CSS. Then use JavaScript to add a class name to a parent element that will override the previous CSS rule:


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

J Query Topics