Introduction

JavaScript is used along with HTML and CSS. It is one of the core technologies of the World Wide Web. Most powerful websites and browsers support JavaScript, like Google, Amazon, Facebook, etc.

History of JavaScript

In May 1995, Brendan Eich developed JavaScript while working with Netscape. JavaScript was created in just 10 days. The first name of JavaScript is “Mocha”, the name chosen by Marc Andreessen, the founder of Netscape.

The language is officially called Live Script when it was first released in beta. Later the finalized name was JavaScript. JavaScript is often abbreviated as JS, and the JavaScript save file extension is .js

Uses of JavaScript

Advantages of JavaScript

Disadvantages of JavaScript

Create Your First JavaScript

In HTML, add JavaScript inside the<body> tag. JavaScript code must insert the “<script>” tag. JavaScript is case-sensitive, see the example given below:

<script>
  //you can write JavaScript Code
</script>

Example

Use JavaScript to print the statement “Welcome to My Article” in a web browser.

<!DOCTYPE html>
<html>
  <head>
    <title>Java Script</title>
  </head>
  <body>
    <script>
      document.write("Welcome to My Article");
    </script>
  </body>
</html>

Output

Add Formatting Text in JavaScript

We can use HTML tags to format text in JavaScript. The text format tag <h1>to<h6>.

Example

<script>
  document.write("<h1>Welcome to My Article</h1>");
</script>

Output

This output size is 32px to 40px (or 2em to 2.5em) because this is <h1>.

Summary

In this article, we have seen a JavaScript introduction. I hope this article was useful to you.