How to set button default state ,active state and Inactive state in jquery mobile.

How to set button default state ,active state and Inactive state in jquery mobile.

On page load I want my button default color should be white  and when we click on yes makes as active (in green color ) and no become as red or vice versa as toggle button.


I try this through jquery  it works but one i add my jqm theme CDN it stop working.

<script type="text/javascript">
$(document).ready(function() {
    $('#myApptBtn').click(function() {
 $(this).addClass('active');
 $('#allApptBtn').removeClass('active').addClass('inactive');
  $('#myApptBtn').removeClass('inactive');
 
    });
$('#allApptBtn').click(function() {
      $('#myApptBtn').removeClass('active').addClass('inactive');
  $(this).addClass('active').removeClass('inactive');
 
    });
});
</script>






 <div data-role="controlgroup" data-type="horizontal">
<a href="#" data-role="button" data-inline="true" data-mini="true" id="myApptBtn" style="width: 101PX;border: black 1PX solid;" class="btnDesign">YES</a>
<a href="#" data-role="button" data-inline="true" data-mini="true" id="allApptBtn" style="width: 101PX;border: black 1PX solid;" class="btnDesign">NO</a>
</div>