JavaScript
90 Best JavaScript Certification Courses in 2021
JavaScript is the most popular client-side scripting language supported by all browsers. It is...
In this tutorial, you will learn-
JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage. In other words, you can make your webpage more lively and interactive, with the help of JavaScript. JavaScript is also being used widely in game development and Mobile application development.
JavaScript was developed by Brendan Eich in 1995, which appeared in Netscape, a popular browser of that time.
Being a scripting language, JavaScript cannot run on its own. In fact, the browser is responsible for running JavaScript code. When a user requests an HTML page with JavaScript in it, the script is sent to the browser and it is up to the browser to execute it. The main advantage of JavaScript is that all modern web browsers support JavaScript. So, you do not have to worry about whether your site visitor uses Internet Explorer, Google Chrome, Firefox or any other browser. JavaScript will be supported. Also, JavaScript runs on any operating system including Windows, Linux or Mac. Thus, JavaScript overcomes the main disadvantages of VBScript (Now deprecated) which is limited to just IE and Windows.
To start with, you need a text editor to write your code and a browser to display the web pages you develop. You can use a text editor of your choice including Notepad++, Visual Studio Code, Sublime Text, Atom or any other text editor you are comfortable with. You can use any web browser including Google Chrome, Firefox, Microsoft Edge, Internet Explorer etc.
You should place all your JavaScript code within <script> tags (<script> and </script>) if you are keeping your JavaScript code within the HTML document itself. This helps your browser distinguish your JavaScript code from the rest of the code. As there are other client-side scripting languages (Example: VBScript), it is highly recommended that you specify the scripting language you use. You have to use the type attribute within the <script> tag and set its value to text/javascript like this:
<script type="text/javascript">
<html>
<head>
<title>My First JavaScript code!!!</title>
<script type="text/javascript">
alert("Hello World!");
</script>
</head>
<body>
</body>
</html>Note: type="text/javascript" is not necessary in HTML5. Following code will work.
<html>
<head>
<title>My First JavaScript code!!!</title>
<script>
alert("Hello World!");
</script>
</head>
<body>
</body>
</html>
JavaScript is the most popular client-side scripting language supported by all browsers. It is...
There are many tools available for Java management. These software ease the entire process of...
What is OOPS Concept in JavaScript? Many times, variables or arrays are not sufficient to simulate...
What is compareTo() method in Java? compareTo() is used for comparing two strings...
What is a Prime Number? A prime number is a number that is only divisible by 1 or itself. For...
What is Stack Memory? Stack in java is a section of memory which contains methods, local...