M1D19: JavaScript Basics


  • A programming language’s commands, special words and punctuation.
  • The rules of the language, or vocabulary.


  • a set of instructions that perform specific tasks when executed by the computer.


  • often used to inspect the inner workings of your websites and applications.


  • a command that’s built into the browser. It opens a dialog box and displays a message.

JavaScript Statement

  • is just like a sentence, but ends in a ;


  • prints a message to the console


  • document represents the current web page, and write is a command that writes a message to the current web page.
alert("Hello. Thansk for visiting!");
console.log("Hello from the console.");
document.write("<h1>Welcome to my web page!</h1>");

Add JavaScript to HTML

  • HTML – Content
  • CSS – Syle
  • JavaScript – Interactivity

JavaScript Engine

  • A program (or interpreter) built into the browser that executes JavaScript code.

Running the Program

  • When a browser reads and acts on a JavaScript program, we call that running the program.
  • It’s also called, “executing the program.”

Linking a JavaScript file to an HTML file

<script src="js/script.js"></script>

Debug JavaScript in the Console

  • console
This entry was posted in Study Notes. Bookmark the permalink.

Leave a Reply