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

127
Views
Cómo no ocultar mi elemento de formulario después del envío si su estilo de visualización css no se configuró previamente como ninguno

 $(()=>{ $("#c").click(function loop(event){ $("#a").show(1000).submit(function(event){ if ($("#b").val() === "hello"){ $("#a").hide(1000); } else{ alert($("#b").val() + " was typed!"); } }); }); });
 #a{ display: none; }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <form id="a"> name : <input type="name" id="b" value="type 'hello' to hide!"></form> <button id="c">do it!</button>

En el fragmento anterior, no quiero que el cuadro de entrada desaparezca de la pantalla cuando se escribe algo que no sea hola . Debería mostrar el mensaje $("#b").val() + " was typed!" pero no debe esconderse.

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

0

Espero que esto ayude.

En realidad, no estaba oculto, sino que se eliminó el propio DOM.

 $(()=>{ $("#c").click(function loop(event){ $("#a").show(1000).submit(function(event){ event.preventDefault(); if ($("#b").val() === "hello"){ $("#a").hide(1000); } else{ alert($("#b").val() + " was typed!"); } }); }); });
 #a{ display: none; }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <form id="a"> name : <input type="name" id="b" value="type 'hello' to hide!"></form> <button id="c">do it!</button>

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!