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

159
Views
el valor en la entrada no está definido

Estoy haciendo una calculadora AP pero el valor de la respuesta no está definido en el campo de entrada de la respuesta que tiene la identificación "An", por favor ayuda; aquí está mi código:

 <!doctype html> <html> <head> <meta charset="utf-8"> <title>JavaScript Example</title> </head> <body> <!-- first term --> <input type="text" value="1" name="" id="a1" onkeyup="ap()"> <!-- number of term --> <input type="text" value="2" name="" id="n" onkeyup="ap()"> <!-- difference --> <input type="text" name="" value="3" id="d" onkeyup="ap()"> <input type="text" name="" id="An"> <script> ap() function ap() { let a1 = document.getElementById("a1").value; let n = document.getElementById("n").value; let d = document.getElementById("d").value; var An = Number(a1) + ((Number(n) - 1) * Number(d)); console.log(An) document.getElementById("An").value = An.value } </script> </body> </html>
por favor ayuda en la solución del problema.

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

0

Cambie el valor de An. a simplemente An, ya que An es solo una variable

 document.getElementById("An").value = An;
about 4 years ago · Juan Pablo Isaza Report

0

Debes asignar la variable 'An' directa en el valor.

 document.getElementById("An").value = An
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!