A sleek web-based calculator built with HTML, CSS, and JavaScript, handling basic arithmetic and percentage calculations.
- Arithmetic:
+,-,*,/for core math operations - Percentage:
%for quick percentage computations - Clear:
Cresets everything - Backspace:
⌫removes the last character - Keyboard Support: Type directly for ease
- Responsive Design: Works on any device
- Setup
- Place
index.html,style.css, andscript.jsin one folder - Open
index.htmlin a browser (Chrome,Firefox, etc.)
- Place
- Operations
- Input: Click or type
0-9,.for numbers - Math: Use
+,-,*,/buttons or keys - Result: Hit
=orEnterto calculate - Reset:
Corcclears display - Delete:
⌫orBackspaceremoves last input
- Input: Click or type
- Percentage (Additional Feature)
- Add/Subtract:
100 + 20% =→120 - Multiply:
200 * 25% =→50
- Add/Subtract:
- Keyboard
- Numbers:
0-9,. - Operators:
+,-,*,/,(,) - Other:
%,Enter(calculate),Backspace(delete),c(clear)
- Numbers:
- Errors: Shows
"Error"or"Infinity"for invalid inputs (e.g., divide by zero) - Precision: Decimals rounded to
4places - Brackets: Auto-handles and closes brackets
- Styling: Clean white base, subtle shadow, rounded buttons, red operators, blue hover effects
- Modern browser (e.g.,
Chrome,Firefox,Safari,Edge)