Assignment GDB Solution: Javascript


How to print text on page

The HTML <script> tag is used to insert a Java Script into an HTML page. Example:1 How to write or print the text on a page. Output! Example 2 <html> <head> <script type=”text/javascript”> function displayDate() { document.getElementById(“demo”).innerHTML=Date(); } </script> </head> <body> <h1>My First Web Page</h1> <p id=”demo”>This is a paragraph.</p> <button type=”button” onclick=”displayDate()”>Display Date</button> […]