abc.ejs
<tbody>
<% data.reverse() %>
<% for(var i=0; i < data.length; i++) { %>
<tr>
<td># <%= data[i].id %></td>
<td><%= data[i].email_address %></td>
<td><%= data[i].mobile_number %></td>
<td><%= data[i].status %></td>
<td><%= data[i].credit_limit %></td>
<td><a href="#" class="btn btn-info btn-md"><span class="glyphicon glyphicon-pencil"></span>Edit</a></td>
</tr>
<% } %>
</tbody>
Each row will have an Edit
button and I would like to retrieve the values of that particular row when user clicks on it. How can I implement this in NodeJS
?
You can use button click event
jQuery('.editBtn').on('click', function() {
var $row = jQuery(this).closest('tr');
var $columns = $row.find('td');
$columns.addClass('row-highlight');
var values = "";
jQuery.each($columns, function(i, item) {
values = item.innerHTML;
alert(values);
});
console.log(values);
});
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.