Javascript function call is not working
    <html>
    <head>
    <script type="text/javascript">
    function displayDate()
    
    {
    alert("hi");
     var d=new Date();
     var theDay=d.getDay();
     switch (theDay)
     {
     case 5:
       document.write("Finally Friday");
       break;
     case 6:
       document.write("Super Saturday");
       break;
     case 0:
       document.write("Sleepy Sunday");
       break;
     default:
       document.write("I'm looking forward to this weekend!");
     }
     
    </script>
    </head>
    <body>
    <h1>My First Web Page</h1>
    <p id="demo">This is a paragraph</p>
    alert("before function call");
    <button type="button" onclick="displayDate()">Display Date</button>
    alert("after function call");
    </body>
    </html>
Javascript function call is not working
===

    <html>
    <head>
    <script type="text/javascript">
    function displayDate()
    
    {
    alert("hi");
     var d=new Date();
     var theDay=d.getDay();
     switch (theDay)
     {
     case 5:
       document.write("Finally Friday");
       break;
     case 6:
       document.write("Super Saturday");
       break;
     case 0:
       document.write("Sleepy Sunday");
       break;
     default:
       document.write("I'm looking forward to this weekend!");
     }
     
    </script>
    </head>
    <body>
    <h1>My First Web Page</h1>
    <p id="demo">This is a paragraph</p>
    alert("before function call");
    <button type="button" onclick="displayDate()">Display Date</button>
    alert("after function call");
    </body>
    </html>