Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda