I'm trying to get the Flower Name and Location when a user clicks on the stars, so I can send the information to a database api endpoint.
I've tried getting the row information which works, but indexing into the row with cell[0] or cell[1] doesn't work.
let tr = star.parentElement.parentElement;
console.log(tr)
Console Output
<tr class="odd">
<td class="sorting_1">1</td>
<td>flower</td>
<td>Purple Roze Flower</td>
<td>45</td>
<td>3.5</td>
<td>Ascend Montclair</td>
...
</tr>
Indexing out of, then back into the element seemed to do the trick.
let tr = star.parentElement.parentElement;
let id = tr.children[0].innerHTML;
let product_name = tr.children[2].innerHTML;