Home  • Programming • JavaScript

JavaScript hello world program

You can print plain text or html in the html document dynamically with javascript functions 1. document.write() and 2. document.writeln()
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JavaScript Lesson1</title>
<script type="text/javascript">
 //Here you can write javascript
</script>
</head>
<body>
<script type="text/javascript">
  document.write("<b>Hello world</b>"Wink;
  document.writeln("<b>Hello world</b>"Wink;
</script>
</body>
</html>

Output

Hello Word Hello Word

Comments 1


<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>JavaScript Lesson1</title> <script type="text/javascript">  //Here you can write javascript </script> </head> <body> <script type="text/javascript">   document.write("<b>Hello world</b>"Winking;   document.writeln("<b>Hello world</b>"Winking; </script> </body> </html>
Copyright © 2024. Powered by Intellect Software Ltd