title: Clear timeout of a functions inside global function
body: <p>I have set a function that loads on document ready with name myFunction. There are 5 functions inside it with different timeouts. I want to clearTimeout of 3rd and 4th functions on clicking a button inside my html code with id #btn . Here is my code</p>
  
  <pre><code>&lt;doctype! HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;
  My Page
  &lt;/title&gt;
  &lt;script src="jquery-3.2.1.js"&gt;
  &lt;script src="myScript.js"&gt;
  &lt;script type="text/javascript"&gt;
  $(document).ready(myFunction);
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;button id="btn"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>myScript.js is below</p>
  
  <pre><code>function myFunction(){
  setTimeout(function function1(){
   // do stuffs
  }, 5000);
  setTimeout(function function2(){
   // do stuffs
  }, 10000);
  setTimeout(function function3(){
   // do stuffs
  }, 15000);
  setTimeout(function function4(){
   // do stuffs
  }, 20000);
  setTimeout(function function5(){
   // do stuffs
  }, 25000);
  }
  </code></pre>