JavaScript Tutorial - KmarsHub

Jump to



Welcome to JavaScript Tutorial at KmarsHub

JavaScript (Shortly "JS") is a programming language (scripting language) that enables an HTML document to dynamically interact on websites. Like responding when buttons are pressed or data is entered in forms etc. JavaScript can easily inserted in HTML. No need of anything else just an HTML Tag.

This tutorial has been made for JavaScript beginners.
So, You don't need any previous JavaScript Knowledge.

But You should have a little bit knowledge of HTML and CSS.

In this tutorial you'll learn JavaScript from basic to advanced.

JavaScript is an easy language to learn. Nothing to worry about.

As you worked with HTML and CSS you know about Source Code and Code Editor. You are free to use our Online HTML Code Editor forever.


Examples in Each JavaScript Tutorial.

You also agree that practical is better than theory. Therefore, We have provided Examples in each Javascript tutorial. Click on the "Demo" button to easily understand.

With "KmarsHub Code Editor", you can edit the source code and preview the result.

Basic Example

Basic JavaScript

Demo


Why We Learn Javascript?

Because JavaScript is one of those Three languages which every web developer must learn.

These are the Three languages that all web developers learn:

   1. HTML to define the content of web pages

   2. CSS to specify the layout of web pages

   3. JavaScript to program the behavior of web pages

JavaScript (JS) is not only for Web pages. Many desktop and server programs also uses JavaScript. Node.js is the best known.


Did You Know?

JavaScript and Java are completely different languages, both in concept and design.

JavaScript was invented by Brendan Eich in 1995.

You can read more about the different JavaScript History in the chapter JS History.


Learning Route and Speed

You are highly recommended to read this tutorial, in the series listed in the left menu.

If you get tired, take a break, or reread the material.

Always make sure you understand all the "Demo" examples.



See Also



Page Details

Click on Next Button to Start (JavaScript) JS Tutorial.




Danger

Note

Warning

Info

Intro

Tips

Tricks




Example

<!DOCTYPE html>
<html>
<title>HTML Tutorial</title>
<body>

<!-- comment --> <h1>This is a heading</h1>
<p class="kmars">This is a paragraph.</p>

</body>
</html>


Example

body {
  background-color: lightblue;/* comment */
}

.h1 {
  color: white;
  text-align: center;
}

#p {
  font-family: verdana;
  font-size: 20px;
}
a:hover{background-color: green !important;}



Example

function myFunction() {
  var x = document.getElementById("demo");
  x.style.fontSize = "25px"; /* comment */
  x.style.color = "red";
}


Top ↑