JavaScript - Getting Started

Getting Started

Prerequisite

Before learning JavaScript, you need basic knowledge of computer. If you don't have this you can go to my Computer Basics tutorial and start learning from there.

Secondly, you need to have good knowledge of HTML and CSS; because you need to know the structure and styling of what you what to make dynamic, add effects to and more.
If you haven't, kindly go to my HTML Tutorial and CSS Tutorial to start learning.


Where To Place JavaScript

There are four (4) ways to place JavaScript.

  • Embedded - use the <script> tag placed inside the <head> tag.
  • Body - use the <script> tag placed inside the <body> tag; using various attributes like onClick, onLoad, etc.
  • Inline - use various attributes such as: onClick, onLoad, onKeypress; placed inside the opening tag of an element.
  • External - use the <script>link tag to connect the external script sheet to the HTML document.

EMBEDDED

BODY

INLINE

EXTERNAL

note
NOTE:

src attribute is used to specify the script address or location.
type attribute is used to specify the type of file.


ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT