What you'll build

  • Support addition, subtraction, multiplication, and division.
  • Show a clear error for division by zero.
  • Add keyboard support and a reset button.

Your building plan

  1. Create labeled number inputs and an operation selector.
  2. Read and validate both input values.
  3. Calculate the result when the form is submitted.
  4. Display the result in a live output region.
  5. Test negative values, decimals, and division by zero.

Start with a small prototype

13px
main.jsYour ideas, in code.
Loading your editor…
Run your code to see the output here.
Ready to buildUTF-85 lines

Share your project with the world

The finished project is a complete HTML file. Download it and open it in a browser to explore the interface and its JavaScript.

  1. Move your interface into an index.html file and your logic into script.js.
  2. Test keyboard controls, small screens, and empty or invalid inputs.
  3. Commit your files to a new repository without any secrets.
  4. Choose a static hosting service, connect the repository, and deploy the project.
  5. Open the published URL on another device and try the complete flow.