Skillz: Write “JavaScript is not Java” on the board 200 times

Description

A longtime tradition of The Simpson’s opener, Bart Simpson is seen writing a phrase over and over on the chalkboard–presumably as punishment for some offense. We, however, are in better circumstances. We can easily crank out as many “I will not…” type phrases as we want (well, until the browser crashes, anyway).

For this Skillz activity, create a JavaScript program that outputs a phrase 200 times to an HTML page. You may use Codepen for completing this activity or you may create this Skillz as an HTML and JavaScript pair of files. The phrase you use is for you to choose. Just keep it clean.

There are three main components to this Skillz:

  1. A for loop to count the number of times to repeat the action
  2. An HTML element to display the repeated phrase and a variable to hold the JavaScript reference to that element
  3. The string concatenation operator

Need a greater challenge? Add some style to the HTML and split the repeated phrase so that it spans over multiple columns, much as Bart Simpson’s does on the chalkboard.

Materials and Technology

  • Text editor or Codepen
  • Browser

Objective

  1. Demonstrate repeating actions over a set number of iterations using a for loop
  2. Demonstrate writing content to an HTML element via JavaScript

Deliverable

  • HTML page posted to student account with pen embedded (if used), or link to Skillz via portal page
  • URL to Skillz posted to corresponding dropbox basket in eCompanion course shell

Comments are closed.