Skip to content

Instantly share code, notes, and snippets.

@ulisesantana
Last active February 14, 2017 22:19
Show Gist options
  • Save ulisesantana/9b4ed305d9cd3cb9a34eba8830532eb3 to your computer and use it in GitHub Desktop.
Save ulisesantana/9b4ed305d9cd3cb9a34eba8830532eb3 to your computer and use it in GitHub Desktop.
Jugando con elementos y con JavaScript en línea
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Jugando con elementos</title>
</head>
<body>
<button onclick="modal.show()">MODAL</button>
<dialog id="modal">
<h1 onclick="console.log(modal)">Ver el componente dialog por la consola</h1>
<p onclick="closeDialog(modal)">Cerrar</p>
</dialog>
<script>
function closeDialog(dialog){
dialog.close();
console.log(dialog);
console.log(dialog.id);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment