A simple and responsive calculator built using HTML, CSS, and JavaScript. This project performs basic arithmetic operations and is designed to help beginners understand DOM manipulation and event handling in JavaScript.
- ➕ Addition
- ➖ Subtraction
- ✖️ Multiplication
- ➗ Division
- 🟰 Real-time calculation using button inputs
- 🧹 Clear and reset functionality
- 📱 User-friendly interface
- HTML – Structure
- CSS – Styling and layout
- JavaScript – Logic and functionality
calculator/
│
├── index.html # Main HTML file
├── style.css # Styling
├── script.js # Calculator logic
└── README.md # Project documentation
- Button clicks are captured using event listeners
- User input is stored as a string
- The
eval()function is used to evaluate the expression - The result is displayed in the input box
-
Clone the repository
git clone https://github.com/your-username/calculator.git
-
Open
index.htmlin your browser -
Start calculating 🎉
- Add keyboard support
- Improve UI/UX
- Replace
eval()with a safer custom logic - Add scientific calculator features
Contributions are welcome! Feel free to fork the repository and submit a pull request.
This project is open-source and available under the MIT License.