Actually i want to set the Modal on the box-click so i put the onclick tag in the box tag but after that my modal is not appear... Actually i passed the unique-Id for the individual box and that's work's fine but the Modal is not appear.....So please help me
<?php
include("connect.php");
$query="SELECT * FROM `orders`";
$filter_Result=mysqli_query($con,$query);
$count=0;
while($row = mysqli_fetch_array($filter_Result)){
$count++;
$boxid = $count;
echo "<div class='block'>";
echo "<div class='boxed' id=$boxid onclick='myFunction($boxid)'>";
"<button id='$boxid'>Open Modal</button>";
"<div id='$boxid' class='modal'>";
"<div class='modal-content'>";
"<span class='close'>x</span>";
"<p>Some text in the Modal..</p>";
"</div>";
"</div>";
echo "<div id='container'>";
echo "<td>" . $row['id'] . "</td>" ."<br>";
echo "<td>" . $row['status'] . "</td>"."<br>";
echo "<td>" . $row['created_date'] . "</td>"."<br>";
echo "<td>" . $row['uid'] . "</td>"."<br>"."<br>"."<br>"."<br>";
echo "</div>";
echo "</div>";
echo "</div>";
}
?>
<script>
function myFunction(id) {
//modal = document.getElementById($id);
//window.alert(modal);
// Get the button that opens the modal
//var btn = document.getElementById("myBtn");
window.alert(id);
document.getElementById(id).innerHTML = Date();
}
</script>