I would like to know a way to disable and enable, using jQuery, a dynamically added html button.
I'm aware of the .on() function, but in order to work, this function needs an event to listen to (like a click or something) and I don't have any event to bind because I'm calling it from a function.
This is the actual code, which is not working because the button with "#myID" is a partial which has been injected dynamically after the document ready():
var validateForm = function(){
if(exp_valid && cc_valid && ch_valid && cvn_valid){
$('#myID').prop('disabled', false);
}
}
I would like a proper way to select, with no event, my dynamically added button.
Thank you for reading.