I have a dynamic table and in one of the attributes of that table I have edit link, I want to fetch the data adjacent to that link if that link is clicked.
For example if I click Edit on line number 2, I should be able to retrieve Demo User, demouser, demo@demo.com and User using javascript.
The key is to access the row and then find elements inside that row:
$('.your-link').click(function () {
const row = $(this).closest('tr');
const whatever = row.find('.whatever').text();
})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.