html - display date in javascript -


trying teach myself javascript. however, cannot figure out why following code doesn't work. ideas?

<!doctype html> <html>     <body>      <p> click button display date</p>      <button onclick="showdate()">hit me</button>      <script>         function displaydate()         {           document.getelementbyid("test").innterhtml=displaydate();            }     </script>      <p id="test"></p> </body> 

copy , pasted wrong, here actual code:

<!doctype html> <html>     <body>      <p> click button display date</p>      <button onclick="showdate()">hit me</button>      <script>         function showdate()         {           document.getelementbyid("test").innterhtml=date();            }     </script>      <p id="test"></p> </body> 

document.getelementbyid("test").innterhtml=date();    

should be

document.getelementbyid("test").innerhtml=date();    

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -