Reset progress bar after form submit using jQuery
You can simply do that:
$('.progress-bar').attr('style', "width: 0%");
Here the snippet:
$('#reset').on('click', function (e) {
$('.progress-bar').attr('style', "width: 0%");
});
$('#upload').on('click', function (e) {
$('.progress-bar').attr('style', "width: 100%");
});
body {
margin: 10px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="bar-position">
<div class="col-md-14 col-md-14 progress-container">
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-success" style="width:100%"></div>
</div>
</div>
<button id="upload" type="button" class="btn btn-primary">Upload</button>
<button id="reset" type="button" class="btn btn-primary">Reset</button>
</div>
You progress bar uses width
property to show progress. To reset it use the following:
$('.progress-bar').css("width","0%");