These are my strings and their speeds at which they will be displayed
var typed = new Typed(".auto-input", {
strings: ["Hi, blahblahblah.", "blahblahblah...", "...blahblahblah?"],
typeSpeed: 75,
backSpeed: 75,
loop: true
});
This is my code for when my checkbox is checked
var checkbox = document.getElementById('checkbox');
checkbox.addEventListener('change', () => {
document.body.classList.toggle('dark');
});
I tried an if statement
if (document.body.classList.toggle('dark')) {
typed.push(["lorem"]);
}
But then i realized, i think i need to select the "strings" in my "typed" vaiable. I'm not quite sure how to do that. I apologize in advance for any mistakes, this is my first question posted on StackOverflow.
As you want to push
"lorem"intostringsinsideTyped, your if statement should look like: