HTML Tutorial
<dialog>
:يُستخدم عنصر <dialog>
لإنشاء نافذة حوار نموذجية تحتوي على عنوان وزر لإغلاقها. يمكن فتح نافذة الحوار من خلال عنصر <button>
أو رابط.
<dialog>
:<dialog>
:<button onclick="myDialog.show()">Open Dialog</button>
<dialog id="myDialog">
<h2>My Dialog</h2>
<p>This is a simple dialog.</p>
<button onclick="myDialog.close()">Close</button>
</dialog>
<!DOCTYPE html>
<html>
<head>
<title>Exploring the <dialog> Tag</title>
</head>
<body>
<button onclick="myDialog.showModal()">Open Dialog</button>
<dialog id="myDialog">
<h2>My Dialog</h2>
<p>This is a simple dialog.</p>
<button onclick="myDialog.close()">Close</button>
</dialog>
<script>
const myDialog = document.getElementById('myDialog');
</script>
</body>
</html>