Getting the source of this click event in JQuery

0 votes

I have multiple dynamically created buttons with the same class on my page and when I try to call a function on the click of the button, the function gets called for all of the buttons with the same class. I want the function to be called for this click event only. Here is my function:-

$(".js-btn-plus").click(function (e) {
var link = $(e.target);
var val = link.next('.value').text();

val++

link.next('.value').text(val);
});

Jul 21 in Web Development by gaurav
• 17,580 points
15 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
0 answers

Getting the source of this click event in JQuery

I have multiple dynamically created buttons with ...READ MORE

Jul 22 in Web Development by gaurav
• 17,580 points
14 views
0 votes
0 answers

Purpose of evt in jQuery event function

What is the purpose of using the ...READ MORE

Jul 25 in Web Development by gaurav
• 17,580 points
9 views
0 votes
0 answers
+1 vote
1 answer

What are the different types of pop-up boxes available in JavaScript?

There are  basically three types of pop-up ...READ MORE

answered Jan 22, 2020 in Web Development by Niroj
• 82,740 points
725 views
0 votes
1 answer

What does cors means in Angularjs and what the use of it?

CORS is Cross Origin Resource Sharing which means you ...READ MORE

answered Jan 29, 2020 in Web Development by kartik
• 37,500 points
2,930 views
0 votes
1 answer

What is jQuery?

Hey, jQuery is a fast and concise JavaScript ...READ MORE

answered Feb 14, 2020 in JQuery by kartik
• 37,500 points
308 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,740 points
8,878 views
0 votes
1 answer

Uncaught Error: Bootstrap's JavaScript requires jQuery

Hello @kartik, You have provided wrong order for ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,740 points
15,869 views
0 votes
1 answer

How to make Bootstrap popover Appear/Disappear on hover instead of click?

Hello @kartik, Set the trigger option of the popover to hover instead ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,740 points
1,302 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP