The JavaScript basics demo of a web page that counts words.
This demonstration was made for the Intro to JavaScript talk at SoDA.
Take a look at the talk slides and talk recording.
This git repository contains a web page (index.html
) which loads a JavaScript file (demo.js
) using a <script>
element. In demo.js
, we count how many words a person has typed into a text area as they type, and display the word count below the text area. The word count turns green when they have met their goal, which they write in a text box, for the number of words.
In this code, we use functions, if statements, strings, numbers, const
and let
declarations, and the DOM (Document Object Model).
Check demo.js
for the code and a walkthrough of how it works.