I am trying to extract the last 'tr' of a table and find out the value of the 3rd cell of this last tr. I use the following instruction
alert($("#requirements_table tr:last").find("td")[1].text());
but I get the error:
HTMLTableCellElement> has no method text
Table structure
<table id="requirements_table"> <% @requirements.each do |requirement| %> <tr> <td><div contenteditable><%= requirement.id %></div></td> <td><%= requirement.requirement_info %></td> <td><%= link_to 'Show', requirement %></td> <td><%= link_to 'Edit', edit_requirement_path(requirement),:class=> "edit_req" %></td> <td><%= link_to 'Destroy', requirement, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% end %> </table>
source share