When I write
$("#new_lang").click(function(e)
{
alert("something");
e.stopPropagation();
});
What is e here, and why doesn’t the function work without it?
Why can I write anything instead of e?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
eis the event object that the handler receives. You need not use “e” specifically as the variable name, you can call it anything you want (as long as it’s not any number of keywords!), many call iteventfor example.Yes, you can do without it, since it’s the first argument,
arguments[0]also works, but I wouldn’t go that route. You can see this working here, but again I would just use the argument declared like it is currently so it’s very explicit.