1
I would like to make list(Gem) of A-Z
.
A detail, based on breaking/dividing this list(Gem) alphabet into parts:
Although my difficulty is in, after being clicked on the button, the same bring up the list so:
1st click the button - then the first part be charged in this order.
To B C D And F G H I
2nd click the button - then it is loaded to second part.
J K L M N The P Q V
3rd click on the button - then 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 +1 to the variable.
For example: I have a variable count
receiving the value 0
initial, by clicking this button the same begins the count++
to 1 and so on, executing each declaration block within the stwich/case
.
For more 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 faced difficulty in making this selection every click on the button.
Any hint, suggestion and simple and/or practical examples, everything to contribute, will be welcome as an answer.