Note: document.querySelector('.someClass') is an easy way to refer to html elements using an identifying class, we won't get into the mechanics during this intro course
Now view your site. Enter a name in the text field and click the 'Greet' button. You should see an alert pop up greeting you by name.
For a more interesting example to walk through, enter the following html into your body tag:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<h1>Numberguessinggame</h1><p>Wehaveselectedarandomnumberbetween1and100. Seeifyoucanguessitin10turnsorfewer. We'll tell you if your guess was too high or too low.</p><divclass="form"><labelfor="guessField">Enteraguess: </label><inputtype="text"id="guessField"class="guessField"><inputtype="submit"value="Submit guess"class="guessSubmit"></div><divclass="resultParas"><pclass="guesses"></p><pclass="lastResult"></p><pclass="lowOrHi"></p></div>
And the following Javascript into your script.js file: