Skip to content

Instantly share code, notes, and snippets.

Created Sep 1, 2021
What would you like to do?
<!DOCTYPE html>
<html lang="es">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Prevenir que usuario deje la página - By Parzibyte</title>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias placeat laborum, magni fugiat ab, rerum iure
ducimus, asperiores sequi dolores ex quos labore exercitationem vitae modi autem repudiandae pariatur earum!</p>
window.addEventListener("beforeunload", (evento) => {
if (true) {
evento.returnValue = "";
return "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment