Open In App

Create a Crowdfunding Platform using HTML CSS & JavaScript

Last Updated : 25 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

In this article, we will see how we can implement a Crowdfunding Platform with the help of HTML, CSS, and JavaScript. The crowdfunding platform project is a basic front-end prototype developed using HTML, CSS, and JavaScript.

Preview of final output: Let us have a loo at how the final project will look like.

crowdfund
Output Preview

Prerequisites:

Approach:

  • 1. Create a new project folder and organize it with the following files: index.html, styles.css, and script.js.
  • 2. Open index.html in a code editor and create the basic HTML structure.
  • 3. Apply CSS for visual styling and layout.
  • 4. The JavaScript code of the project to handle contributions and update the total funds raised as
    • Set up event listeners to respond to user actions, such as clicking the "Contribute" button.
    • Validate the contribution input to ensure it's a valid amount.
    • When a valid contribution is made, update the total fund raised in real-time.
    • Clear the contribution input field after a successful contribution.
    • Provide a user alert to acknowledge their contribution.
    • Check whether gaol is reached or not, if reached then alert a message.

Example: Below is the implementation of the Crowdfunding Platform using HTML, CSS, and Javascript.

HTML
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" 
          content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./style.css">
    <title>Crowdfunding Platform</title>
</head>

<body>
    <header class="header">
        <div class="head-bck">
            <div class="title">
                  <h2>Crowdfunding Project</h2>
            <div>
        </div>
    </header>
    <div class="outer-div">
        <main>
            <div class="main-bck">
                <div class="project-details">
                    <h3>Unit for Change</h3>
                    <p id="goal">Goal: $1000</p>
    
                    <div class="container">
                        <div class="contribute-form">
                            <h3>Please Contribute</h3>
                            <input type="number" 
                                   id="contribution-amount" 
                                   placeholder="Enter amount" min="0">
                            <button id="contribute-button">
                                  Contribute
                              </button>
                        </div>
                        <div class="total-raised">
                            <h3>Total Fund Raised</h3>
                            <p id="total-amount">$100</p>
                            <div id="progress-bar"></div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
    </div>
    <p class="cpyrght">&copy; 
          2023 Crowdfunding. 
          All rights reserved.
    </p>
    <script src="./index.js"></script>
</body>

</html>
CSS JavaScript

Output:


Next Article

Similar Reads