Computer Science 180
Web Design

Fall 2011, Siena College

Lecture 14: More JavaScript
Date: Wednesday, October 26, 2011

Agenda

Lecture Assignment 14

Due at the start of class, Friday, October 28.

Please submit answers to these questions either as a hard copy (typeset or handwritten are OK) or by email to jteresco AT siena.edu by the start of class. Please use a clear subject line when submitting by email (e.g., CS 180 Lecture Assignment 14, Joe Student). We will discuss these questions at the start of class, so no late submissions are accepted.

Consider the class example functionstylemore.html as you answer these questions.

  1. When someone clicks on the "Press Here!" button, what values are given to the three function parameters id, txt, and color, and why? (2 points)
  2. Rewrite the function to use the names p1, p2, and p3 for the parameters. (3 points)
  3. What is the advantage of the original parameter names as opposed to p1, p2, and p3? (2 points)
  4. Modify the original version of the function to take a fourth parameter that would set the background color of the same element whose text and color are already being changed. (3 points)

Links