Skip to content

Instantly share code, notes, and snippets.

@cferdinandi
Created January 16, 2019 20:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cferdinandi/2d47e9e83f33f526eab50b5474a9787c to your computer and use it in GitHub Desktop.
Save cferdinandi/2d47e9e83f33f526eab50b5474a9787c to your computer and use it in GitHub Desktop.
Word count project template from https://learnvanillajs.com.

Project Details

Write a script that displays the number of words in a block of text in real time as the user types.

Considerations

  • How would a visitor using a screen reader know when the text displaying the word count has changed?

Need help?

This project is part of the Vanilla JS Academy.

<!DOCTYPE html>
<html>
<head>
<title>Project Template</title>
<style type="text/css">
body {
margin-left: auto;
margin-right: auto;
max-width: 40em;
width: 88%;
}
/**
* Forms
*/
textarea {
min-height: 24em;
width: 100%;
}
</style>
</head>
<body>
<h1>Word Count</h1>
<textarea id="content"></textarea>
<div id="word-count"></div>
<script>
// Project code...
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment