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

241
Vistas
Get meta value of td (React Js

Lets say I already have this <td meta="Special forces" >View</td> and I need to get meta. How can I get it? I am using react js and using document.getelementByTagName() is bit tricky. Advice please

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Since you're using React, you can make use of ref. Please find the below example which I've tried.

import { useEffect, useRef } from "react";

export default function App() {
  const ref = useRef();
  useEffect(() => {
    console.log(ref.current.getAttribute("meta"));
  });
  return (
    <div className="App">
      <table>
        <tbody>
          <tr>
            <td ref={ref} meta="Special forces">
              View
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  );
}

Try to look the code here in Sandbox here which I tried.

about 4 years ago · Juan Pablo Isaza Denunciar

0

If you want to get every td element with meta attirbute, you can use querySelector with td[meta].

const elements = document.querySelectorAll('td[meta]');
console.log(elements);
<table><tr><td meta="Special forces" >View</td></tr></table>

btw, there is no meta attribute in td tag in HTML5.

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