title: Calling a Function defined inside another function in Javascript
body: <p>I am calling a function on button click like this:</p>
  
  <pre><code>&lt;input type="button" onclick="outer();" value="ACTION"&gt;​
  
  function outer() { 
      alert("hi");       
  }
  </code></pre>
  
  <p>It works fine and I get an alert:</p>
  
  <p>Now when I do like this:</p>
  
  <pre><code>function outer() { 
      function inner() {
          alert("hi");
      }
  }
  </code></pre>
  
  <p>Why don't I get an alert? </p>
  
  <p>Though inner function has a scope available in outer function.</p>