HTML and CSS Reference
In-Depth Information
Code
Explanation
for (j=0;j<alphabet.length;j++) {
Iterates over all of the letters in the alphabet
uniqueid = "a"+String(j);
Constructs the unique identifier
thingelem = document.getElementById
(uniqueid);
Gets the element
thingelem.removeEventListener('click',
pickelement,false);
Removes the event handling for this element
}
Closes the j iteration
}
Closes the cur test to determine if the
hanging is complete
}
Closes the if (not) test (bad guess by
player)
var id = this.id;
Extracts the identifier for this element
document.getElementById(id).style.display
= "none";
Makes this particular alphabet button
disappear
}
Closes the function
</script>
Closes the script
</head>
Closes the head
<body onLoad="init();">
Opening tag that sets up call to init
<h1>Hangman</h1>
Puts the name of game in big letters
<p>
Opening tag for paragraph
<canvas id="canvas" width="600" height="400">
Opening tag for canvas element. Includes
dimensions.
Your browser doesn't support the HTML5
element canvas.
Message for people using browsers that don't
recognize canvas
</canvas>
Closing tag for canvas
Search WWH ::




Custom Search