JavaScript Class

Home Help Table of Contents Class Stuff

Class Stuff


This page contains day-by-day examples of the subjects
learned in this course. Additionally, you can download the
syllabus in Word or PDF formats


Documents

  Download Course Syllabus (Word format)
  Download Course Syllabus (PDF)
  Get Your Course Files


JavaScript Examples

Day 1 [summary]

Basic

Write text with JavaScript
Format text with HTML tags

Where to put the JavaScript

JavaScript in the head section
JavaScript in the body section
An external JavaScript

Variables

Declare a variable, assign a value to it, and display it

Functions

Function
Function with an argument
Function with an argument 2
Function that returns a value
Function with arguments, that returns a value

Day 2 [summary]

Conditionals

If statement
If...else statement
Random link
Switch statement

Looping

A for loop
Looping through HTML headers
A while loop
A do..while loop

Day 3 [summary]

String Object

Count characters in a string (length() method)
Test if a string contains a specified character (indexOf() method)
Test if a string contains a specified character (match() method)
Return a specified part of a string (substr() method)
Uppercase or lowercase characters? (toLowerCase() and toUpperCase() methods)

Day 4 [summary]

Array Object

Make an array that stores names
Find out how many elements an array contains

Day 5 [summary]

Date Object

Today's date
Current local time
Set date
Display current weekday
Display a complete date with the name of the day and the name of the month

Math Object

Round a number to the nearest whole number (round() method)
Random number between 0 and 1 (random() method)
Random number from 0-10 (random() method and round() method)
Test which of two numbers, has the highest value (max() method)
Test which of two numbers, has the lowest value (min() method)

Day 6 [summary]

Window Object

Change the text in the <title> tag of a document
Display an alert box
Display an alert box with line breaks
Display a prompt box
Open a new window when clicking on a button
Place the new window in the top/left
Close a window
Location
Refresh page
Change text in the status bar
Print page

Frames

Break out of a frame
Update two frames
Update two other frames

Day 7 [summary]

Forms

Validate an e-mail address
Validate a value
Validate a length of an input
Form validation
Set focus on an input field
Select text in an input field
Radio button
Checkbox
Select from a dropdown list
Select more than one option
Set focus on the next field when the current field's maxlength has been reached

Day 8

Browser (Client info)

Detect the client's browser
More details about the client
Detect details about the client's monitor
Redirect the user to different pages, depending on browser
Write a different message to the user, depending on the browser





Home Help Table of Contents Class Stuff