Untitled


SUBMITTED BY: Guest

DATE: Aug. 19, 2016, 12:07 a.m.

FORMAT: Text only

SIZE: 930 Bytes

HITS: 616

  1. // get and setup (if needed) the other page elements --------------------------
  2. var scoreArea = document.getElementById("scoreArea");
  3. scoreArea.innerHTML = "Score: " + MAXNUM;
  4. var instructionArea = document.getElementById("instructionArea");
  5. instructionArea.innerHTML = "Guess an integer between 0 and " + MAXNUM + ".";
  6. var playArea = document.getElementById("playArea");
  7. var commentArea = document.getElementById("commentArea");
  8. commentArea.innerHTML = REPINIT;
  9. var guessField = document.getElementById("guessField");
  10. var guessLength = ((MAXNUM.toString()).length).toString();
  11. guessField.setAttribute("maxlength", guessLength);
  12. guessField.setAttribute("size", guessLength);
  13. var guessButton = document.getElementById("guessButton");
  14. guessButton.setAttribute("onclick","checkGuess()");
  15. var resetButton = document.getElementById("resetButton");
  16. resetButton.setAttribute("onclick","location.reload()");

comments powered by Disqus