Window.confirm()
Window.confirm()
- מציגה תיבת דו-שיח עם תוכן וכפתורי אישור וביטול.תחביר
result = window.confirm(message);
message
- מחרוזת שתופיע בגוף ההודעה.result
- ערך בוליאני בו מצוינת בחירת המשתמש (אישור או ביטול).
דוגמאות
if (window.confirm("Do you really want to leave?")) { window.open("exit.html", "Thanks for Visiting!"); }
הדוגמה תציג את ההודעה הבאה:
הערות
The following text is shared between this article, DOM:window.prompt and DOM:window.alert תיבות דו-שיח מונעות מהמשתמש גישה לממשק התוכנית עד אשר היא תיסגר.
מפרט
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'confirm()' in that specification. |
Living Standard |
תאימות דפדפן
BCD tables only load in the browser