Javascript Change text when button is clicked
<p>Hi i want to change the text inside a div when the button is click.</p>

<pre><code>&lt;div&gt;
    &lt;p id="part1"&gt;Hello&lt;/p&gt;

    &lt;button type="button" onclick="myFunction()"&gt;Next&lt;/button&gt;
&lt;/div&gt;



&lt;script&gt;
function myFunction() {
document.getElementById("part1").innerHTML="WORLD";
}
&lt;/script&gt;
</code></pre>

<p>This works perfectly. I have a div that has a text and a button inside, in this case it has the word "Hello". With the code i have when i click the button the word "hello" change to the word "WORLD". I want to make something like a sequence to change the word from "hello" to "world", from "world" to "welcome" and from "welcome" to "my program" (example). and all that with clicking the button multiple times.</p>
