Word & Character Counter
Words: 0
Characters: 0
Features:
Dynamic Counts:
- Automatically updates the word and character counts as the user types.
Clear Text Button:
- Clears the text area and resets the counters to zero.
Responsive Design:
- Works perfectly across all devices, including desktops, tablets, and smartphones.
Colorful Styling:
- Stylish gradient background and polished elements for a professional look.
Word Count Logic:
- Counts words by splitting text based on whitespace and filters out empty strings.
Character Count:
- Includes all characters, including spaces and newlines.
How It Works:
Typing:
- As the user types in the text area, the
oninputevent triggers theupdateCounts()function.
- As the user types in the text area, the
Word & Character Calculation:
- The script calculates words and characters dynamically and updates the respective counters.
Reset:
- Clicking the "Clear Text" button erases the content and resets the counters.
No comments:
Post a Comment