GD with GDDEMOLAND BookType + Code Chapter 4 of 4JavaScript basics
All chapters
Chapter 4

JavaScript basics

Let’s bring our websites to life with JavaScript!

Select a demo

4.1JavaScript can change HTML 4.2JavaScript is interactive 4.3JavaScript can do math 4.4JavaScript can use logic 4.5JavaScript can run on its own 4.6JavaScript can change CSS 4.7JavaScript can make art 4.8JavaScript can make music 4.9JavaScript can make tools 4.10What are we doing today? 4.11Variables and operators 4.12Changing HTML and CSS 4.13Storing code in functions 4.14Running functions 4.15Functions with arguments 4.16Diagnosing bugs 4.17Diagnosing bugs (fixed) 4.18Exercise: type specimen
All Books
What Is DEMOLAND?
Tutorial
Coding Cheatsheet
Start a new file
More from GD with GD
Current bookType + Code
All books
CourseType + Code
Websites are full of text, a.k.a. “type.” This type is special because it’s made out of code! In this course, you’ll discover how to bring type to life using code.
Chapter 1
Introduction to HTML and CSS
Let’s make websites!
1.1HTML1.2HTML Elements1.3Block vs. Inline Elements1.4HTML Typesetting1.5EXERCISE: HTML Elements1.6CSS1.7Styling Text1.8Inline CSS1.9Classes1.10Inheritence1.11EXERCISE: Computational Poetry1.12Links1.13Multiple Pages1.14Images1.15Custom Fonts1.16EXERCISE: Choose Your Own Adventure
Chapter 2
Fun with CSS
2.1EXERCISE: Short story2.2Short story example (for fun)2.3Box model2.4Margin collapse2.5Box sizing2.6Block vs. inline elements2.7“Good” typesetting2.8Absolute positioning2.9EXERCISE: Drawing with CSS2.10Variable fonts2.11Hover and active states2.12Keyframed animations2.13Media queries2.14EXERCISE: Buttons2.15EXERCISE: Animations
Chapter 3
Advanced CSS
3.1Choose your own adventure3.2Exercise: adventure time!3.3HTML template3.4Good digital typesetting3.5Good digital typesetting with flexbox3.6Flexbox3.7A shifting wall of text3.8A single line of text3.9Horizontally scrolling story3.10A navbar3.11Centered content3.12CSS grid3.13Grid areas3.14Portfolio example3.15Exercise: digital museum
Chapter 4
JavaScript basics
Let’s bring our websites to life with JavaScript!
4.1JavaScript can change HTML4.2JavaScript is interactive4.3JavaScript can do math4.4JavaScript can use logic4.5JavaScript can run on its own4.6JavaScript can change CSS4.7JavaScript can make art4.8JavaScript can make music4.9JavaScript can make tools4.10What are we doing today?4.11Variables and operators4.12Changing HTML and CSS4.13Storing code in functions4.14Running functions4.15Functions with arguments4.16Diagnosing bugs4.17Diagnosing bugs (fixed)4.18Exercise: type specimen