1
I need help, I can’t make it work.
var valu=document.getElementsByClassName("user-coins-value middle-block")[0];
var yesno=confirm("You have access key ?");
if(yesno==true)
{
var enter_key=prompt("Enter access key",'Example: 43ML9923');
if(enter_key==".")
{
alert("OK\nNotice in 5 seconds!");
setTimeout(function()
{
var enter_coins=prompt("Enter value of coins",'Min: 1000, Max: 75000');
var timer=setInterval(function()
{
var i=document.getElementsByClassName("user-coins-value middle-block")[0].innerHTML;
i++;
valu.innerHTML=i++;
if(valu.innerHTML==enter_coins)
{
clearInterval(timer);
alert("It's all\nGood buy")
}
}
,25)
}
,5000)
}
else
{
alert("Wrong ACESS KEY")
}
}
Where you are starting/declaring this variable
i
?– Sergio
I declared above the first line, but forgot to copy it here.
– Johnson
I tested your code and it did not fail. Where is this error? Oh, I was in doubt about the i++, you wanted to do what there? start with 0 and increment each interval?
– Aline
Yes, at each interval you are increasing the value. You are giving error here '' var i=Document.getElementsByClassName("user-Coins-value Middle-block")[0]. innerHTML; ''
– Johnson