How can I download Navneet General Knowledge

JavaScript basics

JavaScript is a programming language that can be used to add interactive content to a website (for example: games, reactions by pressing buttons or entries in forms, dynamic appearance, animations, etc.). This article will help you get started with this exciting language and give you an idea of ​​what is possible.

What is JavaScript Really?

JavaScript ("JS" for short) is a full-fledged and dynamic programming language which, when added to an HTML document, ensures dynamism and interaction with the user. JS was invented by Brendan Eich, co-founder of the Mozilla Project, the Mozilla Foundation, and the Mozilla Corporation.

JavaScript is incredibly versatile. You start out very simply with simple features, such as carousels, (picture) galleries, variable layouts and reactions to button clicks. Then, as you become more proficient with the language, you can use it to create entire games, animated 2D and 3D graphics, database-based apps, and much more!

JavaScript itself is very compact and yet flexible. Many developers have written additional tools / extensions for working with JavaScript in order to get even more efficiency out of JS with little effort. These functions are:

  • Programming interfaces (APIs) that were implemented in browsers in order to expand them with JS functions, e.g. the dynamic creation of HTML or the setting of a CSS style, interception and manipulation of video streams, generation of 3D graphics / audio samples and much more...
  • Third-party APIs that enable developers to integrate functions from other pages into their own pages, e.g. from Twitter or Facebook.
  • Third-party frameworks and libraries that can be added to HTML that make it possible to create websites and apps quickly.

Since this article is intended to give you an easy introduction to the basics of JavaScript, we will not discuss the differences between the JavaScript language base and the above extensions here. You can learn in detail later what this is all about in our JavaScript learning area.

Here we are going to show some basics of JavaScript and you will be able to experiment with some browser APIs. Have fun!

A "Hello world!" example

The previous paragraph sounds very exciting and rightly so. JavaScript is one of the most exciting technologies on the Internet and when you start your website will become a lot more powerful.

However, JavaScript is a little more complex than HTML and CSS. You will therefore have to start small and move forward in short, regular steps. To start, we'll show you how to add JavaScript code to a page to say "Hello World!" Example (the standard in elementary programming examples).

  1. First, go to your test page and create a new file called. Save this file in your scripts folder.
  2. Then go to the file and add the following element on a new line before the closing tag:
  3. This does the same thing as the element for CSS - it integrates the JavaScript file on the page so that it can have an influence on the HTML code (and also on the CSS code and everything else on the page).
  4. Now paste the following code into the file:
  5. Make sure the Javascript and HTML files are saved and loaded in a browser. The website should look like this:

Note: We wrote the