Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Der Titel des Dokuments</title> <style> dialog{width:40%;} </style> </head> <body> <div> <dialog id="DialogExample"> <p> Es ist irgendein Text. </p> <button id="hide">Dialogtext schließen</button> </dialog> <button id="show">Dialogtext anzeigen</button> </div> <script type="text/JavaScript"> (function() { var dialog = document.getElementById('DialogExample'); document.getElementById('show').onclick = function() { dialog.show(); }; document.getElementById('hide').onclick = function() { dialog.close(); }; })(); </script> </body> </html>