Basic calculator with JavaScript

A function named eval() is already available in java script so you just have to pass the arithmetic expression to this eval function.

Sample Source Code will look like this.

  • Create a html file with name of calculator.html
  • Add code shown below and open this file
  • Your sample calculator is ready.

Previous Next