Auto refresh & click & alert

Viewed 44

Hello im working in javascript script with extension tampermonkey to refresh and check if there is available dates in appointement website if true then alert , my script work till click in input to show calendar and if i don't click the script doesn't work

this is my script

var gun=setInterval(function(){
if (document.getElementsByClassName('day activeClass').length !==0) {
  new Audio('https://www.soundjay.com/mechanical/sounds/smoke-detector-1.mp3').play();
  clearInterval(gun);
    }
   }, 1000)

i want to add a click in calendar input to detect changes or if there is alternative ways to check even hidden class or in source code of webpage

calendar html code

<input type="text" readonly="" class="form-control-input app_date validate" style="width: 260px;" id="app_date" name="app_date" placeholder="YYYY-MM-DD" onchange="this.form.submit();showLoader();" value="" autocomplete="off">

before click calendar

after click calendar

1 Answers

The problem must be that the classes "day activeClass" won't be assigned to the elements unless you click on the input.

It'd have been better if you had also shared the HTML code of an example of appointments.

But I think you could have a global variable such as "x" and have it include the innerHTML of the calendar and alert if the new data wasn't the same as x

Related