There is a scenario I am encountering where clicking on a button triggers a pop-up with the message "Do you want to perform this operation?". The pop-up contains two buttons, OK and Cancel. Once either button is pressed, control must be passed to the controller for the required task.
I tried using windows.open method after researching on Google, but I faced issues with applying CSS and the lack of a specific URL. This approach did not work as expected.
Another attempt involved hiding a div containing the data initially when the page loads, and then showing it upon clicking. However, this method did not provide the desired popup effect.
<body onload="hide()">
<center>
<script>
function hide() {
document.getElementById("show").style.visibility = "hidden";
}
function show() {
document.getElementById("show").style.visibility = "visible";
}
</script>
<div id="form">
<form method="get">
<div id="show">Demo</div>
<table>
<tr>
<td></td>
<td><a id="dialog-link" href="">
<button type="button" value="Show Pop up"
onclick="show()">Click</button>
</a></td>
</tr>
</table>
</form>
</div>
</center>
</body>