I am trying to add a class to an element when a payment option is selected on the checkout page of WooCommerce. Here is my code, just for testing using the console to get a response:
jQuery(document).ready(function() {
jQuery("#payment_method_extra_payment_option").on( "click", function() {
console.log('1');
});
});
I am targeting the radio button which has this id name. It is not working.
I have also tried using click(), which also does not working.
I can get this code to work when targeting a piece of text outside the payment options. I don't understand why this does not work.