Here is my code
jQuery('#choice_1_10_3_1').attr('checked','checked');
I want to check this radio button when the page load. I could not found error in console but my code is not working.
It is essential for me to do. Any help will be appreciated.
Here is my code
jQuery('#choice_1_10_3_1').attr('checked','checked');
I want to check this radio button when the page load. I could not found error in console but my code is not working.
It is essential for me to do. Any help will be appreciated.
 
    
     
    
    The code will be run after the page is fully loaded.
Try this :
$(window).load(function() {
    $('#choice_1_10_3_1').attr('checked', true);
});
 
    
    It is possibly executing before the DOM is ready to be queried, try this:
jQuery(function() {
    jQuery('#choice_1_10_3_1').attr('checked','checked');
});
It might also be that you need to use .prop('checked', 'checked') instead of attr. I can never remember!
