Hi Harshraj ,
try the below code to disable the forward and backward button on the page
window.onload = function() {
if (typeof history.pushState === "function") {
history.pushState(null, null, document.URL);
window.addEventListener("popstate", function() {
history.pushState(null, null, document.URL);
});
} else {
window.location.hash = "#no-back";
window.location.hash = "#";
window.onhashchange = function() {
window.location.hash = "#no-back";
};
}
};