A simple, interactive web-based calculator application built with vanilla JavaScript, HTML, and CSS. This project demonstrates fundamental JavaScript concepts including DOM manipulation, event handling, and basic arithmetic operations.
- Basic Arithmetic Operations: Perform addition, subtraction, multiplication, and division
- Real-time Calculation Display: See the current calculation and result update instantly
- Operation Logging: All operations are logged to the browser console for debugging
- Clean UI: Modern, responsive design with a user-friendly interface
- No Dependencies: Built with pure vanilla JavaScript - no frameworks or libraries required
basics-01-starting-project/
├── index.html # Main HTML file
├── assets/
│ ├── scripts/
│ │ ├── vendor.js # DOM element references and output functions
│ │ └── app.js # Calculator logic and event handlers
│ └── styles/
│ └── app.css # Styling and layout
└── README.md # Project documentation
-
Open the Application
- Simply open
index.htmlin your web browser - No build process or server required
- Simply open
-
Perform Calculations
- Enter a number in the input field
- Click one of the operation buttons (+, -, *, /)
- The result will be displayed below
- Continue performing operations - each operation uses the current result as the starting point
-
View Operation Logs
- Open the browser's developer console (F12)
- All operations are logged with details including:
- Operation type
- Previous result
- Input number
- New result
- HTML5: Structure and semantic markup
- CSS3: Styling and responsive design
- Vanilla JavaScript (ES6+): Calculator logic and DOM manipulation
- Google Fonts: Roboto font family
This application works on all modern browsers that support ES6 JavaScript features:
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Contains DOM element references
- Handles output display functions
- Manages the connection between JavaScript logic and HTML elements
- Implements calculator logic (add, subtract, multiply, divide)
- Handles user input and calculations
- Manages operation logging
- Sets up event listeners for button clicks
This project demonstrates:
- DOM manipulation and element selection
- Event handling and listeners
- Arrow functions and ES6+ syntax
- Basic arithmetic operations in JavaScript
- Code organization and separation of concerns
This project is part of a JavaScript learning course and is intended for educational purposes.