Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
Obtenga el valor meta de td (React Js

Digamos que ya tengo esta <td meta="Special forces" >View</td> y necesito obtener meta. ¿Cómo puedo obtenerlo? Estoy usando react js y usar document.getelementByTagName() es un poco complicado. consejo por favor

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Como está usando React, puede usar ref . Encuentre el siguiente ejemplo que he probado.

 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> ); }

Intente buscar el código aquí en Sandbox aquí que probé.

about 4 years ago · Juan Pablo Isaza Report

0

Si desea obtener cada elemento td con atributo meta , puede usar querySelector con td[meta] .

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

por cierto, no hay un atributo meta en la etiqueta td en HTML5.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!