# Typewriter Effect
by [kirupa](https://www.kirupa.com/about/whatiskirupa.htm) | filed under [Coding Exercises](https://www.kirupa.com/codingexercises/index.htm)
A popular effect on many personal sites and product pages is the ***typewriter effect***. Some text gets typed out one character at a time, pauses for a moment, gets deleted, and is replaced by another phrase. It's a fun way to cycle through a bunch of words without taking up a lot of space. Here is what this effect looks like (or [open it in a new window](https://www.kirupa.com/codingexercises/examples/typewriter_effect.htm)):
Your typewriter effect needs to do the following:
1. Display some static text (such as **I love building**) followed by a phrase that gets typed out one character at a time
2. Once the phrase is fully typed, pause for a moment. Then, delete it one character at a time
3. Once the phrase is deleted, move on to the next phrase. After the last phrase, start over from the first one
4. Display a blinking cursor at the end of the text
For extra credit, keep the cursor solid while characters are being typed or deleted, and only have it blink during the pauses. You can also make the typing feel more human by adding a little randomness to the typing speed.
Onwards!
## Starting Point
Create a new HTML document in your favorite code editor (like Visual Studio Code) and copy/paste the following starting content into it:
```html
Typewriter Effect
I love building
|
```
This gives us our static text, an empty `span` that our phrases will be typed into, a cursor, and the list of phrases we'll be cycling through. The styling and the JavaScript are what you will add entirely on your own!
#### Hint: Some Learning Resources
The following tutorials may provide some helpful tips and techniques to help you with this exercise: [Timers in JavaScript](https://www.kirupa.com/html5/timers_js.htm), [Strings in JavaScript](https://www.kirupa.com/html5/strings_in_javascript.htm), [Introduction to CSS Animations](https://www.kirupa.com/html5/introduction_css_animations.htm), [Using the classList API](https://www.kirupa.com/html5/using_the_classlist_api.htm), [Functions in JavaScript](https://www.kirupa.com/html5/functions_in_javascript.htm)
## Getting Your Badge
Once you have completed this challenge, you have earned the awesome bragworthy privilege of adding the following badge to [your collection](https://forum.kirupa.com/badges/):

To claim it, head over to the forums and respond in the [Typewriter Effect topic](https://forum.kirupa.com/t/typewriter-effect-frontend-coding-exercise/683598). **Be sure to include a link to your solution or insert a copy of your HTML/CSS/JS in the body of the message:**

Once you have created your topic, Kirupa will give you a virtual high-five and ensure this badge is added to your list of assigned badges.
## Stuck? Need Help? Want a Code Review?
We want to make this a fun learning activity. If you are stuck and need help, please [ask on the forums](https://forum.kirupa.com). Please explain your problem in detail and one of the many helpful forum members will help you out.
Similarly, if you want feedback on your code, please also ask in the forums. This would be an excellent chance for you to learn how you can improve your solution from other web developers!