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

1

1 Answer 1

1

You need to use .checkboxradio() for jQuery mobile

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

DEMO

Sign up to request clarification or add additional context in comments.

2 Comments

@Vishnu Do you mean jQuery mobile 1.4.0? Because .prop() shouldn't work either since it's added in 1.6
yea sorry jquery mobile 1.4.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.