How could you make a condition that shows you a certain message after a certain random number is repeated 7 times? For example:
var gana = localStorage.getItem('j1');
if (gana == c) {
alert("Gana jug1");
}
I have that code that in the variable wins you choose a number already entered and saved in localstorage as j1 and if the random number is the same as the entered one it shows you the alert but I do not know how to do it to show me that alert when such number was repeated 7 times and not just one that is like I have the code.
$('#boton-guardar').click(function(){
var num= $('#num1').val();
if (num > 1 && num <13) {
localStorage.setItem('j1', num);
num= $('#num1').val('');
var numero1 = localStorage.getItem('j1');
$("#numj1").html(numero1);
}
else{
alert("Ingresa un numero valido")
}
});
The entered value is saved as j1 in localStorage.