I have such a problem: I need to create a button that will toggle my text. I did it, but it changes only one time (From cat to dog), but how can I toggle, so that it will change from cat to dog and dog to cat until stop button is clicked.
<p id="ryiaf"> CAT
<form action="script.js">
<input onclick="ryiaf.innerText = 'DOG'" type="button" value="CHANGE YOUR TEXT">
</form>