Y
Y
yankoyski2018-03-06 18:46:13
JavaScript
yankoyski, 2018-03-06 18:46:13

How to change the value of a global variable through an event handler?

Code example:

var x = 0;

$(".test").click(function(){
    x++;
});


How to make the global variable x change its value every time the handler is fired?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Zhivagin, 2018-03-06
@yankoyski

So she changes in the above code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question