D
D
Dima Matvienko2018-02-16 00:26:01
JavaScript
Dima Matvienko, 2018-02-16 00:26:01

Javascript button click (disable after clicking 2 times)?

Hello.
Do not write dashingly, I just started to learn.
There is a little code here
function saraiLogik(){
alert("There is an old barn in front of you, maybe you will find something useful there?");
kolobok.many += 10;
changestat();
}
How to make it so that after 2 times pressing the button, the message is displayed today You have already used many times . Or advise what material to study
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2018-02-16
@Stalker_RED

Make a click counter, obviously.
initially 0, with each press increase it. If there are more than two on the counter, we display a message.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question