change checked not working
Hi ! my actual code is not working, the checkbox is not checked as expected
HTML
- <fieldset id="jform_featured" class="btn-group btn-group-yesno radio">
- <input type="radio" id="jform_featured0" name="jform[featured]" value="1">
- <label for="jform_featured0" class="btn">Yes</label>
- <input type="radio" id="jform_featured1" name="jform[featured]" value="0" checked="checked">
- <label for="jform_featured1" class="btn active btn-danger">No</label>
- </fieldset>
JQuery
- <script>
- jQuery(function ($) {
- $(document).ready(function() {
- $("input[name='jform[featured]']").change(function(){
- $("#jform_featured1").prop("checked","");
- $("#jform_featured0").prop("checked","checked");
- });
- });
-
- });
- </script>
Thanks for helping