Window.alert()
- מציגה הודעת אזהרה עם תוכן וכפתור לאישור וסגירה.
תחביר
window.alert(message);
פרמטרים
message
Optional- מחרוזת שתופיעה כגוף ההודעה בתיבת הדו-שיח של ההתראה.
דוגמאות
window.alert("Hello world!");
alert("Hello world!");
שתי הדוגמאות מייצרות את ההודעה הבאה:
הערות
תפקידן של תיבות ההתראה הינן להצגת הודעות שאינן דורשות תגובה מצד המשתמש, מלבד היכרות וקריאת ההודעה.
מפרט
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'alert()' in that specification. |
Living Standard |
תאימות דפדפן
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.