title: How to close an alert automtically using js?
body: <p>I am trying to develop a tool to book the class from our school website using js.</p>
  
  <p>But I meet this problem:</p>
  
  <p>When the number of student meets the maxinum number, the website will appear an alert which stop my code running.</p>
  
  <p>I have tried this method to close it:</p>
  
  <pre><code>window.alert=function(){return true};
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>And the following is the function which can be active after I pretend to click the add-list-button.</p>
  
  <p><a href="https://i.stack.imgur.com/TK0hz.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>So how can I solve this problem?</p>