Fixed up the HTML page and JS code to work in the console.