O'Reilly logo

The Essential Guide to HTML5: Using Games to Learn HTML5 and JavaScript by Jeanine Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Hangman

Hangman
  • CSS styles

  • generating markup for alphabet buttons

  • using an array for a sequence of drawings

  • using a character string for the secret word

  • an external script file for the word list

  • setting up and removing event handling

Introduction

The goal for this chapter is to continue demonstrating programming techniques and the features of HTML5, Cascading Style Sheets (CSS), and JavaScript, combining dynamic creation of HTML markup along with drawing graphics and text on the canvas. The example for this chapter is another familiar game—the paper-and-pencil game of Hangman.

Just in case you need to brush up on the rules, the game is played as follows: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required