Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

How to make progress bar chart using jQuery ?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Suppose you are preparing tabular data on certain data. So, a bar chart is used to represent the data in a graphical way for a better visual aide. The data can vary from age of a group of people to a certain range, marks of a student in a certain subject.

Approach: We will be creating the HTML progress bar whose initial value is 10%. We will design the progress bar in various colors and patterns. Then we will be creating the JavaScript code for the progress bar.

Implementation code:


<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content=
        "width=device-width, initial-scale=1.0">
        .bar {
            width: 500px;
            height: 80px;
            background-color: aquamarine;
            border-radius: 100px;
            display: flex;
            align-items: center;
        .progress {
            width: 467px;
            width: 50px;
            height: 50px;
            background-color: grey;
            border-radius: 100px;
            margin-left: 17px;
        .percentage {
            position: absolute;
            margin-left: 30px;
            font-weight: bold;
        input {
            margin-bottom: 30px;
        Enter a number between 1 
        and 100 for progress
    <input type="number" min="0" max="100">
    <div class="bar">
        <div class="progress">
        <div class="percentage">0%</div>
        const input = document.querySelector('input');
        const progress = document.querySelector('.progress');
        const percentage = document.querySelector('.percentage');
        let percentComplete = 0;
        input.onchange = function () {
            percentComplete = input.value
                `${percentComplete / 100 * 417 + 50}px`;
            percentage.innerHTML = `${percentComplete}%`;


My Personal Notes arrow_drop_up
Last Updated : 23 Nov, 2020
Like Article
Save Article
Similar Reads
Related Tutorials