JavaScript is an object-oriented client-side scripting language that helps you build web-based applications. By client side scripting, we speak of the scripts that run on the web browser.
JavaScript helps you add dynamic effects and enhance the interactivity of the web pages by controlling the information sent by the web server.
The development of JavaScript dates back to the mid 1990s by Brendan Eich, an American Computer Programmer. It was initially called LiveScript and was renamed to JavaScript in 1995. It was accepted as ECMA standard in the year 1997. The ECMA (European Computer Manufacturers Association) officially looks after JavaScript.
All the modern web browsers such as Mozilla Firefox, Google Chrome, and Safari support JavaScript.
There are three methods to add JavaScript in a web page.
Embed the JavaScript Code: Embed the JavaScript code between a pair of <script> and </script> tag. The <script> tag instructs the web browser to interpret the contained statements as executable script.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Embedding JavaScript Code</title>
</head>
<body>
<script>
var j = "Introduction to JavaScript";
document.write(j);
</script>
</body>
</html>