1

I have have checkbox from jquery mobile

     <form>
    <input class="checkclass"   name="d11" id="checkbox-mini-0" data-mini="true" type="checkbox">
    <label for="checkbox-mini-0">Completed This.</label>
   </form>
         <br><br>
         <div id="checkit">check</div>

I am trying to check dynamically based on name="d11" using below js

$('#checkit').click(function() {
$("input[name='d11']").prop('checked', true);
    alert("hi");
});

here is the fiddle ..http://jsfiddle.net/w2jJs/ ..But its not working in jquery mobile.some one please guide me where i am wrong

Anton
  • 32,245
  • 5
  • 44
  • 54
Vishnu
  • 2,372
  • 6
  • 36
  • 58
  • http://stackoverflow.com/questions/17027566/how-to-check-checkbox-dynamically-jquery-mobile/17027734#17027734 – Omar Feb 03 '14 at 16:35

1 Answers1

1

You need to use .checkboxradio() for jQuery mobile

$('#checkit').click(function () {
    $("input[name='d11']").prop('checked', true).checkboxradio('refresh');
});

DEMO

Anton
  • 32,245
  • 5
  • 44
  • 54