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

222
Views
document.getElementById('pwMeter').style.display='none' no funciona como se esperaba

Estoy tratando de ocultar un div usando el siguiente método en una página web de reacción. Pero no oculta el elemento. Tampoco puedo ver ningún error en las herramientas de desarrollo.

 if(pw.length==0){ document.getElementById('pwMeter').style.display='none' }

¿Cuál es el problema aquí? ¿React es compatible con este método?

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

0

sí, con reaccionar puede hacer esto, verifique este código de referencia de muestra para eso

 import { useState } from "react"; const TestFunction = (props) => { const [pw, setpw] = useState(["test"]); return ( <div> <div id="pwMeter" style={pw && pw.length > 0 ? { display: "bock" } : { display: "none" }} > <p>test data</p> </div> </div> ); }; export default TestFunction;
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!