javascript-projects

Task 19: Age Calculator

Description

The Age Calculator is a simple web application that allows users to calculate their age based on their date of birth. This project helps students understand the basics of HTML, CSS, and JavaScript, including working with forms, handling user input, and performing date calculations.

Screenshots of the Project

Age Calculator

Objectives

Technologies Used

Getting Started

Follow these instructions to set up the project on your local machine.

Prerequisites

Installation

Fork this repository by clicking on the fork button on the top of this page. This will create a copy of this repository in your account. And then follow these steps:

  1. Clone the repository to your local machine:
    git clone https://github.com/yourusername/javascript-projects.git
    
  2. Navigate to the project directory:
    cd age-calculator
    

Project Structure

The project files and directories are organized as follows:

age-calculator/
│
├── index.html       # The main HTML file
├── style.css        # The CSS file for styling
└── src.js           # The JavaScript file for functionality

Usage

  1. Open index.html in your web browser.
  2. Enter your date of birth in the provided input field.
  3. Click the “Calculate Age” button to see your age displayed.

Code Explanation

HTML

CSS

JavaScript

Detailed Steps

HTML (index.html)

CSS (style.css)

JavaScript (src.js)

Submitting the Project

After setting up the project on your local machine, and writing the necessary code, follow these steps to submit your project:

  1. Create a new folder/directory on your local machine in the javascript-projects/age-calculator directory. Name it your-name.

For example, if you are using Visual Studio Code, you can create a new folder by clicking on the New Folder icon in the Explorer sidebar and naming it age-calculator.

You folder structure should look like this:

javascript-projects/
│
├── age-calculator/
│   ├── your-name/
│   │   ├── index.html
│   │   ├── style.css
│   │   └── src.js
│
└── ...
  1. Write the necessary code for the project by following the instructions provided in the project description.
  2. Once you have completed the project, push your code to the remote repository on GitHub.

    3.1 Create a new branch:

     git checkout -b your-branch-name
    

    3.2 Stage your changes:

     git add .
    

    3.3 Commit the changes:

     git commit -m "Add project files"
    

    3.4 Push the changes to the remote repository:

     git push origin your-branch-name
    
  3. Create a pull request on the original repository.
  4. Add a title and description to your pull request.
  5. Submit the pull request.
  6. Congratulations! You have successfully submitted your project.

Resources

License

This project is licensed under the MIT License - see the LICENSE file for details.