JSFiddle - React, Tailwind, and code Playground

by bryiantan

HTML

<!DOCTYPE html>

  <meta name="viewport" content="width=device-width, initial-scale=1">
  
  <!--#myBtn {
      width: 300px;
      padding: 10px;
      font-size:20px;
      position: absolute;
      margin: 0 auto;
      right: 0;
      left: 0;
      bottom: 50px;
      z-index: 9999;
  }-->

<div>
  <h2>Modal Events - hy.modal</h2>
  <!-- Trigger the modal with a button -->
  <!--Hide Modal-->

  <!-- Modal -->
  <div class="modal fade" id="myModal">
    <div class="modal-dialog">
    
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <!--Ă—-->
          <h4 class="modal-title">Modal Header</h4>
        </div>
        <div class="modal-body">
          <p>The hy.modal event occurs modal is about to be hidden.</p>
          <p>Click the "Hide Modal" button to trigger the hide method (which will trigger the hy.modal event).</p>
        </div>
      </div>
      
    </div>
  </div> 
</div>
 
 <td><a href="#myModal" data-toggle="modal"><button class="btn btn-primary">Edit Record</button></a></td>

$(document).ready(function(){
    $("#myModal").modal("show");
    
    
        $("#myModal").on('hy.modal', function () {
           
    });
    
});