Getting values from a specific row in a table


#1

I have a table that sort of looks like this:

{{#each names}}
...
<td id="fullNameID">{{fullName}}</td>
<td>{{otherFields}}</td>
...
{{/each}}

I also have a delete button as one of the against each row. How exactly do I get the fullName that is displayed in that row?

I tried something like

$('#userRoleTable #fullNameID').text());

However, every row’s fullName is being picked up. (Eg. name1name2name3…)


#2

Can it be that every td has the same ID?


#3

Right now, I’ve only set id field to only one


#4

Well, that is the explanation then. When you access a field by its ID, you expect to get exactly one result back. If you give the same ID to many fields, how do you suggest javascript should decide which field to return?