This repository contains a collection of beginner-to-intermediate JavaScript programs, each built as a standalone HTML file. The project demonstrates core JavaScript fundamentals such as conditionals, loops, event handling, DOM manipulation, and form validation — all executable directly in the browser.
JS_Basics/
│
├── amstrong.html → Checks whether a number is an Armstrong number
├── arithmetic.html → Performs basic arithmetic operations (+, −, ×, ÷)
├── display.html → Accepts and displays a user-entered string
├── event_handlingimage.html → Changes an image to text on click (event handling)
├── factorial.html → Calculates the factorial of a number
├── fibonacci.html → Generates the Fibonacci series
├── form_input.html → Adds or multiplies two numbers using form input
├── leayear.html → Determines whether a year is a leap year
├── max3.html → Finds the largest of three numbers
├── odd_even.html → Checks whether a number is odd or even
├── prime_or_not.html → Checks whether a number is prime or not
├── random_number.html → Generates a random number within a range
├── str_reverse.html → Reverses a string using a built-in method
├── swap2no.html → Swaps two numbers using a temporary variable
├── validation.html → Validates form fields (empty input, email format, etc.)
├── wish.html → Displays greetings based on time of day
└── images.png → Image asset used in event handling demo
-
Clone this repository
git clone https://github.com/DEMiHAT/JS_Basics.git
-
Open any HTML file directly in your browser.
-
Each file runs independently — no external dependencies required.
- Conditional statements (
if,else,switch) - Loops (
for,while) - User input and output handling
- DOM manipulation and event handling (
onclick,onsubmit) - String and number operations
- Form validation and pattern checking
- Random number generation
- Time-based logic for greetings
| Technology | Purpose |
|---|---|
| HTML5 | Defines page structure and UI elements |
| JavaScript (ES6) | Implements logic, functions, and interactivity |
| CSS (optional) | Provides visual styling for certain files |
Sanjeev Sriram 📧sanjeevsriram06@gmail.com 🌐https://github.com/DEMiHAT
“God will steer the boat, But You must Row” 🚀