This is a basic calculator built using HTML for structure, CSS for styling, and JavaScript for functionality. It supports the following operations: addition (+), subtraction (-), multiplication (x), and division (÷). It also includes a clear button (C) and decimal point (.) functionality.
- Performs basic arithmetic operations: +, -, x, ÷
- Clear button (C) to reset the display.
- Handles decimal input.
- Basic error prevention (e.g., preventing multiple operators or leading operators).
- Simple and attractive user interface.
- HTML5
- CSS3
- JavaScript (ES6)
- Clone or download the repository to your local machine.
- Open the
index.html
file in your web browser. - Use the on-screen buttons to perform calculations. The result will be displayed in the input field at the top.
(Make sure you have a file named calculator.png
in the same directory as your README.md
file for the image to display correctly.)
├── index.html ├── index.js ├── style.css └── calculator.png <-- Output screenshot (if you add one) └── README.md
index.js
: The JavaScript file containing the calculator's logic.
style.css
: The CSS file containing the styling for the calculator.calculator.png
: (Optional) A screenshot of the calculator's output.README.md
: This file, providing a description of the project.
- Implement keyboard support for input.
- Add memory functions (MC, MR, M+, M-).
- Implement more advanced mathematical functions (square root, percentages, etc.).
- Improve error handling and display more informative error messages.
- Refactor the JavaScript code for better organization and readability.
- Make the design responsive for different screen sizes.