Javascript examples for DOM:Document write
Use document.write to output string
<html> <head> <script> var Christmas = new Date ("December, 25, 2017"); var toDay = new Date (); var then = Christmas.getTime(); var now = toDay.getTime(); var diff = (then-now)/(1000*60*60*24); document.write( " [Note: Get ready... There are only " + Math.round(diff) + " days until Christmas!] " ); //from www.jav a 2 s. com </script> <title>abc</title> </head> <body> </body> </html>