Introduction

  • Static html
  • Generated code
  • Share
Loops
Logic
Values
Html
Arrays
Variables
Functions

In this course, you will use block-based programming, like on code.org, to create JavaScript that changes the html on a web page.

This "Introduction" has no tasks, only helpful information. Go to the first exercise whenever you're ready.

  • Static html can be written in the html textarea. "Static" means unchanging. In this case, we mean the original state, before the program changes anything).
  • Use blocks to create code that changes the html.
  • Click "run" to place the html in the space below the textarea and execute the generated code.
  • These exercises assume you have tried block based programming already. Do the code.org course before you start. You should at least have done the lessons up to Conditionals and While Loops.
  • Unlike code.org, in CYF Blocks you can go to the next exercise when you feel ready.
  • Grey checkmarks show that your current code doesn't solve the instruction. Green checkmarks show that it does.
  • The blocks create JavaScript code. You can view the result in the "Generated code" textarea. You are not expected to understand this code yet. (It's interesting to look at, though!)
  • The goal is to use the generated code in your own project. You will copy paste this code into a single .js file and add it, with html and css, to your course project.
  • The way the blocks work (and the code they generate) is very like the code you will learn in the long course. There are also some differences that make the code easier for new learners.

Definitions

Some of the following may need a definition:
  • static vs dynamic
  • block based programming
  • html elements
  • html attributes
  • variable
  • array
  • function
  • function call
  • event handler? - not used, but would be convenient