Stay Tuned!

Subscribe to our newsletter to get our newest articles instantly!

JavaScript

JavaScript – Write First Scripting Program

javascript print hello world

JavaScript has it’s own style of writing codes. It requires the <script> </script> tag.

The JavaScript code can be written inside the <script> and </script> tag.

We will talk more about it later. So here is our first JavaScript example to print “Hello World!“.

Here i am writing inside <body></body>. You can write JavaScript code inside <head> or inside <body>.

If you put your JavaScript code above </body> then your web page will load faster.

HTML/ JS Code

<html>
 <head>
  <title> My First JS Document </title>
 </head>
 <body>
  <script language="javascript" type="text/javascript">
  document.write("Hello World!!");
  </script>
 </body>
</html>

Output

  1. JavaScript discards the white spaces, tabs as well as newly created lines in the JS programs.
  2. JavaScript is a case sensitive language.
Avatar

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.

You may also like

javascript
JavaScript

JavaScript – Introduction, History, and Syntax

  • September 17, 2020
What is “JavaScript”? The first appearance of JavaScript was made in Netscape 2.0 in 1995 with a name Live Script.
javascript
JavaScript

JavaScript – Write Program to Print Hello World!!!

  • September 17, 2020
JavaScript is scripting language which is similar to C. It is syntax and logic are similar to C, C++ and