How to prevent browser back button with alert to user. ?
<script type="text/javascript">
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
alert("Please proceed with Main button");
history.pushState(null, null, document.URL);
});
<script type="text/javascript">
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
alert("Please proceed with Main button");
history.pushState(null, null, document.URL);
});