Initially, the original script worked perfectly with just one class being added:
function check_btn_charge() {
if (parseInt(jQuery(".total-change-price").text()) >= 0) {
jQuery(".btn-action-save-charge"+" "+"btn-danger").prop("disabled", true);
}
else {
jQuery(".btn-action-save-charge"+" "+"btn-danger").prop("disabled", false);
}
}
However, when trying to add more classes by using a plus (+) sign and space character to separate them in the condition as shown below, it did not work as expected:
function check_btn_charge() {
if (parseInt(jQuery(".total-change-price").text()) >= 0) {
jQuery(".btn-action-save-charge").prop("disabled", true);
}
else {
jQuery(".btn-action-save-charge").prop("disabled", false);
}
}
What adjustments should be made to this script to ensure proper functionality?