+ 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?
6 Respostas
+ 7
with a little improvment:
https://code.sololearn.com/WhYS9cBGpUw2/?ref=app
+ 6
few more improvments:
https://code.sololearn.com/W6b4xAYnmkDA/?ref=app
+ 5
https://code.sololearn.com/WAWLWrZx2ORL/?ref=app
+ 3
progressively, by practicing and reading?...
+ 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.
+ 1
for value I mean placeholder, sorry