Before learning javascript one must know about css and html.

Javascript is used to do validation, logic operation and communicate with server.

Javascript is a client side scripting, it executes in browser.

How fast you learn about javascript depends on your interest and practicing.

Types of Javascript

We can write the javascript code in three various ways, they are

  1. Inline javascript
  2. Internal Javascript
  3. External Javascript

Inline Javascript

Inline javascript is written within the html tags.


Try Yourself

Internal Javascript

Internal javascript is written inside the <script> and </script> tags.


Try Yourself

External Javascript

External javascript is written in a separate file and saved with .js extension.

External javascript file can be imported inside the html file using src attribute in <script> tag.

In the below example, a separate javascript file(ext.js) is created. In it we have defined funCall function. To view the javascript file Click //


Try Yourself

We recommend you to define the javascript code above the </body> tag.