Thank you @kevcomedia. That input was very helpful.
There were two other helpful guys in Stack Overflow, too. I used the same title, FYI.
I was amazed to get so much help so quickly!
Unfortunately, I don’t think I described the situation well enough.
There is a form in my HTML with a text box and a check button:
<input id = "textbox" type = "text" name = "word_pair"><br>
<input id = "button" type = "button" value = "Check This!" onclick = "wordCheck();">
Students have a list of adj. and nouns to match. They choose two, input them, and click the button.
I want wordCheck() to do 3 things: (1) check that the words match the pair list & if they do, (2) cross off the words on the list; then (3) drop the words into the value = “” section of a text box, where they will write sentences based on the words. eg. “thirsty water” -> “He looks thirsty. Give him some water.”
I was thinking that if I could solve a simple alert problem, then adding other functionality would be simple.
With your help, the code got much farther in the PythonTutor.com code checker, but now Google Chrome hates my .toLowerCase, saying:
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
Or, if I comment that line out, the alerts fire off almost randomly.
You guys got me much farther, to be sure; and that was a great help.
I just thought I’d give you a thorough update, since you were so thoughtful.
If I get anywhere with this, I’ll let you know.