You can use setInterval() to check the time every x milliseconds, using new Date().
If the time is Y, run whatever action you want.
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval ,
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date