jQuery('input[name^="ko_unique_"]').trigger("change");
jQuery('input[name^="ko_unique_"]').change(function() {
var v = jQuery(this).val();
console.log(v);
if(v == 'simpleshipping_simpleshipping'){
console.log('check');
jQuery('#deliv-hold').show();
}
else{
jQuery('#deliv-hold').hide();
}
});
The above-mentioned code is working fine on the console but when it is used in js. it does not execute after the second line.
Viral Patel
1,1001 gold badge8 silver badges17 bronze badges
1 Answer 1
You should use .on() instead of traditional .change() event,
$(document).on('change', 'input[name^="ko_unique_"]', function(e) {
/* your code here */
}
answered Oct 27, 2021 at 8:29
Rizwan Khan
1,9692 gold badges20 silver badges43 bronze badges
default
if(jQuery.trim(v) == 'simpleshipping_simpleshipping'). and check that