I am trying to put a checkbox like control in the Navbar which should behave like a toggle. When I first select the navbar button it should select all the checkboxes below and clicking again will reset the checkbox.
Here is the code I have to display the controls
<div data-role="page" id="index"> <div data-role="header" data-position="fixed" > <div data-role="navbar"> <ul><li><a href='' data-icon="check">All</a></li></ul> </div> </div> <div data-role="content" id="content"> <ul data-role="listview" data-theme="c" data-dividertheme="d"> <li> <div class="checkBoxLeft"> <input type="checkbox" name="checkbox-0" id="checkbox-0"/> </div> <a href="#" class="msg">Message 1 </a> </li> <li> <div class="checkBoxLeft"> <input type="checkbox" name="checkbox-1" id="checkbox-1"/> </div> <a href="#" class="msg">Message 2 </a> </li> </ul> </div> </div> The JSfiddle link is http://jsfiddle.net/8dyn9e7s/
How do I select all checkboxes on the click on the button and deselect all checkboxes on an another click.
Regards Malai