How can i get value in <tr cost="xx.xx"> if i click on some button with id="minus" or id="plus"?
How can i get value in <tr cost=xx.xx> if i click on some button
Share
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.
You can use the
closest()method.However, you really shouldn’t use non standard html attributes. You could use data attributes instead:
And then access them with the
data()method.Update
Here it is inside a click handler:
With the following updated html that doesn’t have duplicate ids:
Here’s the updated fiddle