I want to select/check a radio button when another radio is selected. I'm using .prop('checked', true); but it is not working.
This is what I have:
add_action( 'woocommerce_after_add_to_cart_form', 'conditionally_hide_show_new_field', 9999 );
function conditionally_hide_show_new_field() {
wc_enqueue_js( "
$('input[type=radio][name=testradio]').change(function() {
if (this.value == 'my_value') {
$('#testradio').prop('checked', true);
}
});
");
}