Call function within the function - Javascript Function

Javascript examples for Function:Function Nest

Description

Call function within the function

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <button onclick="hello()">click here</button> 
      <script type="text/javascript">
function hai(){//from   w  ww . ja  v a  2 s. c o  m
      console.log("hai fun");
 }
function hello(){
     console.log("hello function");
     hai();
    }

      </script>  
   </body>
</html>

Related Tutorials