JSFiddle - React, Tailwind, and code Playground

by mpsingh2003

HTML

<script src="//code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="accordion" id="accordionExample">
  <div class="card">
    <div class="card-header" id="headingOne">
      <h2 class="mb-0">
        <button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
          Launch Request Receieved
        </button>
      </h2>
    </div>

    <div id="collapseOne" class="collapse show" aria-labelledby="headingOne">
      <div class="card-body">
        <div class="text">
          <dl class="row">
            <dt class="col-sm-3">User Agent</dt>
            <dd class="col-sm-9">An HTML user agent is any device that interprets HTML documents.</dd>
            <dt class="col-sm-3 text-truncate">Client-side Scripting</dt>
            <dd class="col-sm-9">Client-side scripting generally refers to the category of computer programs on the web that are executed by the user's web browser.</dd>
            <dt class="col-sm-3">Document Tree</dt>
            <dd class="col-sm-9">The tree of elements encoded in the source document.</dd>
          </dl>
        </div>
        <div class="req-status text-success">
            <span><i class="fa fa-check-square fa-lg"></i></span>
            <span class="ml-1">Valid OIDC Request</span>
        </div>
        <button id="generate_oidc" class="btn btn-primary mt-3">
          Generate OIDC Request
        </button>
      </div>
    </div>
  </div>
  <div class="card d-none" id="card-two">
    <div class="card-header" id="headingTwo">
      <h2 class="mb-0">
...

CSS

.row {
  background: #f8f9fa;
  margin-top: 20px;
}

.col {
  border: solid 1px #6c757d;
  padding: 10px;
}

JavaScript

$("#generate_oidc").on('click', (e) => {
  $("#collapseOne").collapse('hide');

  $("#card-two").removeClass("d-none").addClass("d-block");
  $("#collapseTwo").collapse('show');
})


$("#send_oidc").on('click', (e) => {
  $("#collapseTwo").collapse('hide');
})