title: How to trigger alert function on button press?
body: <p>I have a function that triggers an alert at a given time:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function breakTime() { // &lt;&lt;&lt; do not edit or remove this line!
    /* Set Break Hour in 24hr Notation */
    var breakHour = 11
    /* Set Break Minute */
    var breakMinute = 47
    /* Set Break Message */
    var breakMessage = "Reports! Take Your Break!"
    ///////////////////No Need to Edit//////////////
    var theDate = new Date()
    if (Math.abs(theDate.getHours()) == breakHour &amp;&amp; Math.abs(theDate.getMinutes()) == breakMinute) {
      this.focus();
      clearInterval(breakInt)
      alert(breakMessage)
    }
  }
  var breakInt = setInterval("breakTime()", 1000)</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to assign this function to a button, so when the button is pressed, at an interval of 10 seconds after button press, the alert shows up to everyone that has access to the page. Is there any way to do it? </p>
  
  <p>Note: the pop up alert is triggered without the button, but every one of my attempts to make a button that triggers the function doesn't trigger the pop up on every one's PC. </p>