How do I create a text deletion effect in JavaScript?

  • 0
    I wrote a small function that slowly prints text on load.

    let writelogo = setInterval(() => {
        if (x < logotext.length) {
            logo.innerText += logotext[x]
            x++
            logo.innerHTML.replace(0,2)
        } else {
            
            clearInterval(writelogo)
           
        }
       
    }, 150)


    I just want to remove it as the effect of pressing backspace.
    I don’t ask you to write me a function, just give me an idea, otherwise I didn’t find similar examples to study. thanks
    JavaScript Aidan Guerra, Sep 6, 2020

  • 1 Answers
  • 0

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!