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

149
Views
MathJS analiza los valores del campo de entrada

Estoy tratando de analizar algunos valores como x^2 y x de un campo de entrada, luego los divido usando mathjs

Este es mi JS

 function LDivide() { ldft = document.getElementById("LD1").value; ldst = document.getElementById("LD2").value; var LDans = math.simplify(math.parse(ldft / ldst)); document.getElementById("LDansBox").innerHTML = LDans; document.getElementById("LDansBox").style.display = "inline" }

html de la siguiente manera. Pondría x^2 en el primer campo y x en el segundo, por ejemplo, para obtener x como respuesta porque x^2/x = x

 <input type="text" id="LD1" placeholder="First Term"> | <input type="text" id="LD2" placeholder="Second Term"><br> <button id="LDSubmit" class="btn btn-success" onclick="LDivide()">=</button><br> <p class="ansBox" id="LDansBox"></p>

Simplemente dice NaN .

He intentado buscar una solución sin éxito.

about 4 years ago · Juan Pablo Isaza
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!