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

100
Views
cuadro de texto que va al sitio web cuando la respuesta es correcta

Necesito que el usuario escriba una palabra y, si es la palabra clave correcta, la necesito para cambiar de página.

mi código

 <form action="/yay.html"> <label>what's 1+1</label><br> <input type="text"><br> <input type="submit" value="Submit"> </form>

por ejemplo quiero algo un poco como esto.

 <script> function checkstuff() { if text = "hello world" } </script> //so a function checks if the text is equal to "hello world" <form action="/yay.html"> <input type="text"> <input type="submit" value="Submit" onclick="checkstuff()"> //submit input runs function </form>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

En la solución a continuación, la entrada del usuario se evalúa para habilitar/deshabilitar el atributo deshabilitado del botón de envío.

 const submit = document.getElementById('submit'); let answer = document.getElementById('answer'); const target = 2; function log(value, mode) { console.clear(); if(mode) console.log(`Information: ${value}`); else console.log(`Input: ${value}`); } answer.addEventListener('input', function(event) { log(this.value, true); if(parseInt(this.value) == target) { submit.disabled = false; } else { submit.disabled = true; } }); submit.addEventListener('click', function(event) { log("Button fired.", false); });
 <form action="/yay.html"> <label>what's 1+1</label><br> <input id="answer" type="text"><br> <input id="submit" type="submit" value="Submit" disabled> </form>

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!