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

257
Views
Cómo ocultar <div>

Estoy haciendo una página .html de broma para un amigo. La broma era que presionabas un botón y aparecía una frase debajo del botón. Descubrí una manera de ocultar la frase y mostrarla. El problema es que, cuando carga en la página, la frase ya estaría en la pantalla. ¿Cómo lo mantengo oculto al cargar la página?

 function Function() { var x = document.getElementById("urmom"); if (x.style.display === "none") { x.style.display = "block"; } else { x.style.display = "none"; } }
 <p>Click the "Try it" button to toggle between hiding and showing the DIV element:</p> <button onclick="Function()">Try it</button> <div id="urmom"> ur mom </div> <p><b>Note:</b> The element will not take up any space when the display property set to "none".</p>

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

0

Establecer con CSS primero como NINGUNO.

 function Function() { var x = document.getElementById("urmom"); if (x.style.display === "none") { x.style.display = "block"; } else { x.style.display = "none"; } }
 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <p>Click the "Try it" button to toggle between hiding and showing the DIV element:</p> <button onclick="Function()">Try it</button> <div id="urmom" style="display:none"> ur mom </div> <p><b>Note:</b> The element will not take up any space when the display property set to "none".</p> </body> </html>

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!