7
Type:
1 2 3 ... 4 5 6 ... 7 8 9
And so on and so forth.
Example
var clic = 0;
function mais() {
if (clic == 1) {
document.getElementById('txt').textContent += "1 2 3 "
} else if (clic == 2) {
document.getElementById('txt').textContent += "4 5 6 "
} else if (clic == 3) {
document.getElementById('txt').textContent += "7 8 9 "
} else {
document.getElementById('btn').style.display = 'none';
}
}
<input type="button" value="mais" id="btn" onclick="mais(clic++)" />
<p id="txt"> </p>
In the example above I put a limit for each click, it is not necessary to limit being able to be unlimited for what I need.
Therefore, I just always want to play 3 out of 3 numbers catching the last number and continue in the sequence.
What I want is to automate and improve the function without having to manually define the numbers and their order.
instead of putting the
<script>
at the end of the page, could use a<script defer>
:)– MarceloBoni