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

217
Views
Javascript (not found) error on form submit

I am trying to practice basic javascript on codepen so i made this basic calculator. when i click on the add button the correct answer is showing correctly on the browser but it suddenly disappears and i get not found error.

Here is my code:

let btn = document.getElementById("add")
let result = document.getElementById("result")

btn.addEventListener("click", () => {
  let num1 = parseFloat(document.getElementById("num1").value);
  let num2 = parseFloat(document.getElementById("num2").value);
  result.innerHTML = num1 + num2
})
<form action="">
  <h1>Add two numbers</h1>
  <input id="num1" type="number" required>
  <input id="num2" type="number" required>
  <input type="submit" id="add" value="Add">
</form>
<div>
  <h2 id="result"></h2>
</div>

I tried to check the console but i see nothing.

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!