I have written a code which works on change but now I am also looking into page load and anything happens on the input field which has that specific class like blur or oninput ot paste or whatever, it should trigger the code and the moment the value is more than 0.00, it should run the code and display the label to block
Here is my code
document.addEventListener('readystatechange', function(e) {
switch (e.target.readyState) {
case "complete":
$('.totalsTeal').trigger('change');
break;
}
});
and here is how the change event is written
$(document).on('change focus blur', '.totalsTeal', function() {
let self = $(this);
let day = self.attr('data-name');
if (self.val() === "0.00") {
$('#w1_' + day).parent().find('label').css('display', 'none');
} else {
$('#w1_' + day).parent().find('label').css('display', 'block');
}
});
the above code shows what I have done and what I am trying to write