JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr>
<td>
Скидки в честь весны
</td>
<td>
<div>
<button><a href="javascript:PopUpShow()">Открыть купон</a></button>
<span class="k1">купон1</span>
</div>
<div class="b-popup" id="popup1">
<div class="b-popup-content">
Купон на скидку:
<script>
ContentShow()
</script>
<a href="javascript:PopUpHide()">закрыть</a>
</div>
</div>
</td>
</tr>
<tr>
<td>
Скидки в честь лета
</td>
<td>
<button><a href="javascript:PopUpShow()">Открыть купон</a></button>
</td>
</tr>
</table>
CSS
* {
font-family: Areal;
}
button {
position: relative;
z-index: 0;
text-align: center;
}
.b-popup {
width: 100%;
min-height: 100%;
background-color: rgba(0, 0, 0, 0.5);
overflow: hidden;
position: fixed;
top: 0px;
z-index: 3;
}
.b-popup .b-popup-content {
margin: 40px auto 0px auto;
width: 100px;
height: 140px;
padding: 10px;
text-align: center;
background-color: #c5c5c5;
border-radius: 5px;
box-shadow: 0px 0px 10px #000;
}
JavaScript
function ContentShow() {
$(".b-popup-content").append($(".k1"));
}
$(document).ready(function() {
PopUpHide();
});
function PopUpShow() {
$("#popup1").show();
}
function PopUpHide() {
$("#popup1").hide();
}