Hello World! I have a question about placeholder typing effect using JS... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Hello World! I have a question about placeholder typing effect using JS...

I just made a search box and it's now completed, I wanna make an automated typing effect placeholder in it using JS, I searched for it but didn't work well on me... I wanna put many words on it like if the word "Hello World!" was finish, it will be erased and make a new one like "HelloQnA!"... I used var str = [ "Hello World!", "HelloQnA!" ]; but didn't work... Is making an <input type="text" /> with placeholder typing effect is possible?

7th Feb 2021, 11:04 AM
trash
6 Answers
7th Feb 2021, 11:40 AM
visph
visph - avatar
7th Feb 2021, 11:59 AM
visph
visph - avatar
+ 5
https://code.sololearn.com/WAWLWrZx2ORL/?ref=app
7th Feb 2021, 11:27 AM
visph
visph - avatar
+ 3
progressively, by practicing and reading?...
7th Feb 2021, 12:05 PM
visph
visph - avatar
+ 2
you have to use loops, vars and the element.placeholder. you have to make a loop who changes the placeholder in the search box every second with a new letter and when it finishes, you use an if to erase everything and start a new loop. you can use like a boolean to change from a loop to another while the if changes the boolean to make start a loop or another. if you didn't undertand ping me and I'll make an example.
7th Feb 2021, 11:10 AM
Gabriele Giambrone
Gabriele Giambrone - avatar
+ 1
for value I mean placeholder, sorry
7th Feb 2021, 11:11 AM
Gabriele Giambrone
Gabriele Giambrone - avatar