Skip to content

This project is a collection of beginner-friendly JavaScript programs demonstrating core concepts like DOM manipulation, event handling, user input, and form validation. It includes examples such as Fibonacci series, leap year check, string reversal, image click events, and dynamic greetings.

Notifications You must be signed in to change notification settings

DEMiHAT/javascript-basics

Repository files navigation

🧠 JavaScript Basics Programs

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.


📂 Project Structure

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


⚙️ How to Run

  1. Clone this repository

    git clone https://github.com/DEMiHAT/JS_Basics.git
  2. Open any HTML file directly in your browser.

  3. Each file runs independently — no external dependencies required.


🧩 Concepts Demonstrated

  • 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

🛠️ Technologies Used

Technology Purpose
HTML5 Defines page structure and UI elements
JavaScript (ES6) Implements logic, functions, and interactivity
CSS (optional) Provides visual styling for certain files

👨‍💻 Author

Sanjeev Sriram 📧sanjeevsriram06@gmail.com 🌐https://github.com/DEMiHAT


“God will steer the boat, But You must Row” 🚀

About

This project is a collection of beginner-friendly JavaScript programs demonstrating core concepts like DOM manipulation, event handling, user input, and form validation. It includes examples such as Fibonacci series, leap year check, string reversal, image click events, and dynamic greetings.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages