Web Design II

Lecture 3: Decisions and Loops

This week will be talking about decisions and loops using JavaScript. Decisions are made in code using if statements, i.e. if this value is 5 or above make the background blue if its below 5 make the background red. Loops are one of the main things that makes programming great! We can loop through a large number of tasks and the computer will do those tasks pretty much instantly. For this we use something called a for loop or a while loop..

In Class Assignment

Make the mood ring shown in class have more moods, using the conditional and logic statements you have been taught. Change the text, change the colors. Add any other elements you wish. Consider the power of iterating through lists, the Switch statement, and others when completing this assignment.


Suggested Reading

  • Chapter 4 in "Javascript and JQuery"
  • The Document Object Model context in Chapter 5 in "Javascript and JQuery"

Here are the code examples we worked through today:

here are some videos

If our artists are not versed in technology, who will imagine what we can become, who will ask what we should not be?