Before learning javascript one must know about css and html.

Javascript is used to do validations, logical operations and communicate with server.

Javascript is a client side script, and it executes in browser.

Learning javascript faster 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.

Example

Try Yourself

Internal Javascript

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

Example

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 http://tutorialcodeplay.com/ext.js

Example

Try Yourself

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