Skip to content

A word counter that will update itself as the number of words in the textbox increases or decreases. If the words exceed the maximum limit of 100, the count down number turns red in colour.

Notifications You must be signed in to change notification settings

Juel07/word-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

General info

A word counter that will update itself as the number of words in the textbox increases or decreases. If the words exceed the maximum length of 100, the count down number turns red in colour.

Regex pattern explained

let words = input.value.match(/\b(\S+)\b/gi)

In the above pattern:

  • \b Matches word boundaries i.e. starting or ending of a word
  • \S Not whitespace. Matches any character that is not a whitespace character (spaces, tabs, line breaks)
  • + Quantifier. Matches one or more occurrences of the preceding token
  • i Makes it case insensitive, and g makes it do a global search instead of stopping at first match

To view

Link to project: https://juel07.github.io/word-counter/

Demo

quick website demo

Technologies

  • HTML5
  • CSS3
  • JavaScript

About

A word counter that will update itself as the number of words in the textbox increases or decreases. If the words exceed the maximum limit of 100, the count down number turns red in colour.

Topics

Resources

Stars

Watchers

Forks