CS 213: Web Development

Colan Biemer · All courses

The slides, examples, and practice for CS 213. The lectures follow the course schedule: HTML first, then CSS, then JavaScript.

HTML

What's on a page: elements, tags, and attributes.

Coming soon

HTML Lectures

The HTML slides aren't online yet.

CSS

How a page looks: colors, boxes, tables, and layout.

Borders

Every element is a box: border styles, the border shorthand, accent bars, and rounded corners.

Slides (PDF)

Tables

Lines, gaps, and padding, a header row that stands out, zebra stripes with :nth-child(), and hover.

Slides (PDF)

Layout

Three ways to lay out a page (tables, float, and grid), then position: sticky and media queries for phones.

Slides (PDF)

JavaScript

Making a page do things: variables, operators, and functions.

if Statements

Comparisons and booleans; if, else, and else if; combining conditions with &&, ||, and !; and the ternary operator.

Slides (PDF) · Demo

Objects and Loops

Objects and their properties; while, for, and for...in loops; and break and continue. The exercises are short programs, and the demo builds a stock order book.

Slides (PDF) · Demo

Arrays

Arrays and their methods; looping with an index, for...of, and forEach; arrays of objects; arrow functions; and sort. The exercises are short programs, and the demo builds a trading desk.

Slides (PDF) · Demo

Forms and the DOM

Form controls, labels, and submitting; the DOM as a tree of nodes; and reading and writing the page with getElementById. The exercises are short programs, and the demo builds a photo editor.

Slides (PDF) · Demo

The Document Object Model

Finding many elements at once with getElementsByTagName, getElementsByClassName, getElementsByName, and querySelector; changing styles with classes; and making, adding, removing, and replacing elements. The exercises are short programs, written from scratch, that change a small menu page.

Slides (PDF)

Events

Listening for mouse, keyboard, window, and form events with addEventListener; the event object; bubbling; and stopping the browser's default action with preventDefault. The exercises are short programs, and the demo builds a drawing page.

Slides (PDF) · Demo

Form Validation

Required fields; testing for numbers, letters, or both with regular expressions; limiting the length; checking email addresses; and custom messages with setCustomValidity. The exercises are short programs, and the demo builds a license plate shop.

Slides (PDF) · Demo

Coming soon

Creating a Web API / TypeScript

Creating a web API or TypeScript, then catch-up and review.

Coming soon

Wrap-Up

Wrapping up the course and preparing for the final project.