Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

215
Visualizações
Getting row information from click on a table cell

enter image description here

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>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

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;
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda