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

215
Views
Usando la función onclick para un botón y el contenido del botón (palabras) aparece pero no se puede hacer clic en el botón. ¿Algún consejo?

Solo estoy practicando un poco y parece que no puedo hacer que este botón funcione. He revisado varios sitios y parece que lo estoy formateando correctamente. Todo lo demás en mi código funciona correctamente.

Aquí está el código:

 <html> <head> <title>This is a picoCTF JS Example</title> <script> function myFunctionSum(){ var number1 = document.getElementById("number1").value; var number2 = document.getElementById("number2").value car result = number(number1) + Number(number2); alert(result); } </script> </head> <body> <h1>JavaScript example to add2 numbers</h1> Input the first number<br> <input type="text" id="number1" ><br> Input the second number<br> <input type="text" id="number2" <button onclick="myFunctionSum()"> Show alert! </button> </body> </html>

Es la parte del botón que parece no funcionar. Agradezco toda la ayuda.

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

0

car result = number(number1) + Number(number2); Está incorrecto

prueba esto

 var result= +number1 + +number2 ;
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!