Skip to content
This repository was archived by the owner on Mar 17, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ document.addEventListener('DOMContentLoaded', function() {

/* Helper functions */

var nukeChildren = function(el) {
var nukeChildren = (el) => {
while (el.firstChild) {
el.removeChild(el.firstChild);
}
};

var addText = function(el, text) {
var addText = (el, text) => {
el.appendChild(D.createTextNode(text));
};

var addNewElement = function(parent, el, opt_text) {
var addNewElement = (parent, el, opt_text) => {
var el = D.createElementNS(NS, el);
parent.appendChild(el);
if (opt_text) {
Expand All @@ -101,7 +101,7 @@ document.addEventListener('DOMContentLoaded', function() {
return el;
};

var addNewClass = function(el, class_name){
var addNewClass = (el, class_name) => {
el.className += " " + class_name;
}

Expand Down Expand Up @@ -191,7 +191,7 @@ document.addEventListener('DOMContentLoaded', function() {
};
})();

var makeScoreHandler = function(team) {
var makeScoreHandler = (team) => {
return function() {
var score = window.prompt('Enter new score:', scores[team][0]);
if (score) {
Expand Down Expand Up @@ -253,7 +253,7 @@ document.addEventListener('DOMContentLoaded', function() {
rowset = addNewElement(table, 'tfoot');
row = addNewElement(rowset, 'tr');

var addScoreCell = function(team) {
var addScoreCell = (team) => {
cell = addNewElement(row, 'td');

var div = D.createElementNS(NS, 'div');
Expand Down