I want an alarm to sound 5 minutes before the end of an exam using javascript

Thanks for your reply!

I am just wondering how to start the countdown at exam begin, say June 22, 10am, irrelevant of when the student clicks the button.

If student wants an alarm 5 minutes before the end of the exam, he or she must click the button, because the sound cannot play without input from the user.

But the countdown can start without user input.

That is similar to how I disable the send button for the exam. I have a line like this at the beginning of my html forms:

<form action="php/getcw19BEsW13.php" method="POST" name="myForm" onsubmit="return checkForExpiration();" >

So I need something like (assuming start is 10am):

var terminate = new Date(“June 22, 2020 10:55:00”);
if(startBtn.click AND terminate){

bell.play()
}

Like I said, I don’t know much about javascript, but I’m pretty sure that can be done.

I have been told, for an expert, it is trivial to alter such javascript on a webpage. I do not think our students have sufficient knowledge to do that , though. I certainly do not know how to change that live in a web browser.