I am trying to call a function with parameters using jQuery’s .click, but I can’t get it to work. This is how I want it to work: $(‘.leadtoscore’).click(add_event(‘shot’)); which calls It works if I don’t use parameters, like this: But I need to be able to pass a parameter through to my add_event function. How can I do this specific
Tag: function
What is the scope of variables in JavaScript?
What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally? Answer TLDR JavaScript has lexical (also called static) scoping and closures. This means you can tell the scope of an identifier by looking