I am trying to make the starting text state Hi there, as you can see I am Sheldon Aldridge
and in the javascript sentenceArray
will contain the list of text that will replace the speech-bubble class
with the innerHTML, I started a for loop to cycle through the array, I am not sure how to achieve that?
Outcome: sentenceArray
should replace the speech-bubble
at random with a set time interval in between every random text.
HTML
<div class = "speech-bubble">
<p>Hi there, as you can see I am Sheldon Aldridge</p>
</div>
</div>
JS
let sentenceArray = [
"Fun fact about me, I love video games, I have been playing video games since I was 10 years old",
"I want to be a front end developer because creating and the building is a passion of mine",
"You should really look at the projects I built, you can get a good look at my skillsets",
]
function textgen(sentenceArray){
let speechbubble = document.querySelector(".speech-bubble");
let speechlength = speechbubble.length;
while(speechbubble){
for(let i = 0; i < speechlength; i++){
}
}
}
`
– Inder May 09 '22 at 21:18`.
– Barmar May 09 '22 at 21:19