Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧮 Simple Calculator

A beginner-friendly calculator built with HTML, CSS, and JavaScript. This project is part of my journey to understand JavaScript logic, functions, and DOM manipulation.


🌟 Features

  • Clickable buttons for numbers (0–9) and operators:

    • + Addition
    • - Subtraction
    • x Multiplication
    • / Division
  • ✅ Clear button (CLEAR) to reset the display

  • ✅ Equals button (=) to calculate results

  • 🖥️ Results display updates immediately as you type

⚠️ Note: The calculator is still a work in progress.


🎨 How It Looks

Calculator Screenshot Screenshot showing the calculator interface with numbers and operators.


💻 How to Use

  1. Open index.html in your browser.
  2. Click number buttons to input digits.
  3. Click operator buttons (+, -, x, /) to select an operation.
  4. Click = to see the result.
  5. Click CLEAR to reset the calculator.

🔢 Example of Results

Action Display
5 + 3 = 5 ➕ 3 = 8 ✅
7 x 2 = 7 ✖ 2 = 14 ✅
9 ÷ 0 = 9 ➗ 0 = ❌ Error

🛠️ Technologies Used

  • HTML – structure
  • CSS – styling and layout
  • JavaScript – logic and interactivity

🎯 Learning Goals

This project helped me:

  • Understand HTML structure and CSS styling
  • Learn JavaScript logic, functions, and event handling
  • Manage state for first/second operands and operators
  • Make interactive UI elements like buttons with hover effects

🔮 Future Improvements

Here’s what I plan to add next:

  • Prevent numbers from spilling over the results screen
  • Support multiple chained operations
  • Handle division by zero and other errors gracefully
  • Improve UI responsiveness for mobile and desktop
  • Add keyboard input support
  • Add animations for button clicks
  • Optionally, store history of past calculations

About

A beginner-friendly calculator built with HTML, CSS, and JavaScript to practice JS logic, functions, and DOM manipulation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages