JSFiddle - React, Tailwind, and code Playground

by Calvin Tomkins

HTML

<script src="https://code.jquery.com/jquery-3.4.1.slim.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
<button>Click</button>
<div class="modal fade" id="sumbit-modal" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Processing</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="progress">
          <div id="test" class="progress-bar progress-bar-striped bg-warning progress-bar-animated" role="progressbar" style="width: 100%"></div>
        </div>
        <p id="message" style="display: none; margin-top: 10px;">Thank you for your order! It has been sent to our team and they will be in touch shortly.</p>
      </div>
    </div>
  </div>
</div>

JavaScript

$( "button" ).click(function() {
  $("#sumbit-modal").modal('toggle');
  window.setTimeout(function(){
  $("#test").addClass('bg-success').removeClass('bg-warning progress-bar-animated');
  $("h5.modal-title").html('Success!');
  $("p#message").toggle();
  $(".modal-footer").toggle();
  }, 2000);
});