JSFiddle - React, Tailwind, and code Playground

HTML

<a href="www.google.com" id="calculation">Click me</a>
<br>
<a href="www.google.com" id="validation">Click me</a>

<!-- The Modal -->
<div id="myModal" class="modal">
  <!-- Modal content -->
  <div class="modal-content">
    <!--Close button-->
    <span class="close"><span class="close">×</span></span>
    <!--Insert video here-->
    <div id="modalcontent">
    </div>
  </div>
</div>

CSS

/* The Modal (background) */
.modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  /* Stay in place */
  z-index: 1;
  /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  /* Full width */
  height: 100%;
  /* Full height */
  overflow: auto;
  /* Enable scroll if needed */
  background-color: rgb(0, 0, 0);
  /* Fallback color */
  background-color: rgba(0, 0, 0, 0.4);
  /* Black w/ opacity */
}

/* Modal Content/Box */
.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  /* 15% from the top and centered */
  padding: 20px;
  border: 1px solid #888;
  width: 60%;
  /* Could be more or less, depending on screen size */
}

/* The Close Button */
.close {
  display: block;
  color: #D13135;
  float: right;
  font-size: 50px;
  font-weight: 900;
  line-height: 1;
}

.close:hover,
.close:focus {
  color: #6a6a6a;
  text-decoration: none;
  cursor: pointer;
}

/*Wistia specific CSS

.wistia_responsive_padding {
  margin-top: 50px !important;
}
*/

JavaScript

//Define variable for the modal, close button and innerHTML of videos
var modal = document.getElementById("myModal");
var span = document.getElementsByClassName("close")[0];

var video = `<iframe width="500" height="315" src="https://www.youtube.com/embed/pbRX2ALuy3k" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`

var video2 = `<iframe width="500" height="315" src="https://www.youtube.com/embed/5KNGDZhoRyA" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`

//Close if click on X
span.onclick = function() {
  modal.style.display = "none";
}

//Close if click outside of modal
window.onclick = function(event) {
  if (event.target == modal) {
    modal.style.display = "none";
  }
}

//Inject video 1 into modal
document.querySelector("#calculation").addEventListener("click", function(event) {
    event.preventDefault();
    document.getElementById("myModal").style.display = "block";
    document.getElementById("modalcontent").innerHTML = video;
  },
  false);

//Inject video 2 into modal
document.querySelector("#validation").addEventListener("click", function(event) {
    event.preventDefault();
    document.getElementById("myModal").style.display = "block";
    document.getElementById("modalcontent").innerHTML = video2;
  },
  false);