How can we change heading with respect to time using javascript?

I want to change the heading of the web page. Like I have

<h1>hey there!</h1>

so want to change this heading text with another text with respective time.
and changes should be in the loop.

like I used my values to be store in an array.
eg. var values = [ ‘hi’, ‘hello’, ‘bye’]
how can I use the set.timeout function in for loop to change those values continuously.

10 thoughts on “How can we change heading with respect to time using javascript?”

Leave a Comment