<html>
<body>
<h3>Cat Facts</h3>
<p id="fact">A cat cannot see directly below its nose.</p>
<button onclick="previous()">
Previous
</button>
<button onclick="next()">
Next
</button>
<script>
function next() {
document.getElementById("fact").innerHTML = "Cats first went to space in 1963.";
}
function previous() {
document.getElementById("fact").innerHTML = "A cat cannot see directly below its nose.";
}
</script>
</body>
</html>]]>- The
next()
function gets called to change to a new fact - The paragraph's text stays the same
- Nothing
- The
previous()
function gets called The next()
function gets called to change to a new fact.