Mention constraint validation API as room for future growth

This commit is contained in:
Neale Pickett 2019-02-24 17:13:26 -07:00
parent 60277f6a7e
commit dc4fa96f9e
1 changed files with 3 additions and 0 deletions

View File

@ -161,6 +161,9 @@ function loadPuzzle(categoryName, points, puzzleId) {
document.querySelector("input[name=points]").value = points
}
// Check to see if the answer might be correct
// This might be better done with the "constraint validation API"
// https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Form_validation#Validating_forms_using_JavaScript
function answerCheck(e) {
let answer = e.target.value
let ok = document.querySelector("#answer_ok")