A comprehensive interactive website demonstrating various JavaScript events and DOM manipulation techniques using vanilla JavaScript, HTML, CSS, and Bootstrap.
- onload Event: Welcome alert when page loads
- onchange Event: Dynamic color selection dropdown
- onclick Events: Interactive calculator with arithmetic operations
- onmouseover/onmouseout Events: Color-changing hover box
- onkeydown Event: Real-time keyboard input capture
- onsubmit Event: Form submission with validation
- Color Selector: Dropdown that changes display box colors dynamically
- Calculator: Perform basic arithmetic operations (+, -, ×, ÷)
- Hover Box: Visual feedback on mouse interactions
- Keyboard Tracker: Displays pressed keys and their codes
- Contact Form: User input form with success feedback
- Text Manipulator: String operations (uppercase, lowercase, reverse, count)
- Counter & Timer: Increment/decrement counter with start/stop timer
- Dark/Light Mode Toggle: Theme switching functionality
- Responsive Design: Mobile-friendly layout using Bootstrap
- Form Validation: Required field validation
- Real-time Updates: Dynamic content updates without page refresh
- HTML5: Semantic markup and structure
- CSS3: Custom styling with transitions
- JavaScript (ES6+): Vanilla JavaScript for all interactions
- Bootstrap 5: Responsive grid system and components
- Font Awesome: Icons (if applicable)
You can also view the live demo at: JS_Events_Demo
javascript-events-demo/
│
├── index.html # Main HTML file
├── styles.css # Custom CSS styles
├── script.js # Vanilla JavaScript code
└── README.md # Project documentation
This project demonstrates:
- Event Handling: Various JavaScript event types and their implementation
- DOM Manipulation: Dynamic content updates and element styling
- Form Processing: User input validation and feedback
- String Methods: Text manipulation using JavaScript string functions
- Timing Functions: setInterval and setTimeout usage
- Conditional Logic: Switch statements and if/else conditions
- Variable Scope: Local and global variable management
- Modern web browser (Chrome, Firefox, Safari, Edge)
- Basic understanding of HTML, CSS, and JavaScript
-
Clone the repository:
git clone https://github.com/Narayan0-0/JS_Events_Demo.git
-
Navigate to the project directory:
cd javascript-events-demo
-
Open
index.html
in your web browser:# On macOS open index.html # On Windows start index.html # On Linux xdg-open index.html
- Color Selector: Choose a color from the dropdown to see the display box change
- Calculator: Enter two numbers and click operation buttons to calculate
- Hover Box: Move your mouse over the blue box to see it change color
- Keyboard Input: Type in the text field to see key codes displayed
- Contact Form: Fill out the form and submit to see success message
- Text Manipulator: Enter text and use buttons to transform it
- Counter: Use increment/decrement buttons and start/stop the timer
- Theme Toggle: Click the theme button to switch between light and dark modes
To add new JavaScript events:
- Add HTML elements in
index.html
- Create event handler functions in
script.js
- Attach events using
addEventListener()
or inline handlers
- Modify
styles.css
for custom styling - Use Bootstrap classes for responsive design
- Add CSS transitions for smooth animations
- Extend existing functions in
script.js
- Add new interactive components
- Implement additional JavaScript methods
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-event
) - Commit your changes (
git commit -am 'Add new event handler'
) - Push to the branch (
git push origin feature/new-event
) - Create a Pull Request
This project is licensed under the MIT License.
- Bootstrap team for the responsive framework
- MDN Web Docs for JavaScript documentation
- Community tutorials and examples
⭐ Star this repository if you found it helpful!