I would like to make a list of A-Z
.
One detail, is based on breaking / dividing this list (gem) alphabet into parts:
Although my difficulty is in, after being clicked on the button, the same bring the list like this:
First click on the button - then first part will be loaded in this order.
A B W D AND F G H I
2nd click on the button - then it is loaded to second part.
J K L M N O P Q V
3rd click on the button - then it will end the third part with the rest of the alphabet.
R s T U W X Y Z
Each time I click the same button, I want to add the +1 variable.
For example: I have a count
variable getting the value 0
initial, clicking this button will start the count++
to 1 and so on, executing each declaration block within stwich/case
.
For details, note the logic below:
<script>
window.onload = function(){
var contador = 0;
contador++;
document.getElementById("conta").onclick = function(){
document.getElementById("resultado").innerHTML=contador;
switch (contador){
case "1":
for ( i = 1; i < 9; i++ ){
ler = String.fromCharCode(i+64);
document.body.innerHTML += ler +"<br>";
}
break;
case "2":
for ( i = 1; i < 9; i++ ){
ler = String.fromCharCode(i+64);
document.body.innerHTML += ler +"<br>";
}
break;
case "3":
for ( i = 1; i < 8; i++ ){
ler = String.fromCharCode(i+64);
document.body.innerHTML += ler +"<br>";
}
break;
alert("Ok! Fim de Listagem.\nRetome sua pesquisa.");
}
</script>
However, I have had difficulty making this selection every time I click the button.
Any tip, suggestion, and simplistic and / or practical examples, all to contribute, will be welcome as a response.