()Document.write
- כותב מחרוזת טקסט אל גוף מסמך HTML.
תחביר
document.write(markup);
פרמטרים
markup
- מחרוזת המכילה את הטקסט שיופיע במסמך.
דוגמה
<html> <head> <title>write example</title> <script> function newContent() { alert("load new content"); document.open(); document.write("<h1>Out with the old - in with the new!</h1>"); document.close(); } </script> </head> <body onload="newContent();"> <p>Some original document content.</p> </body> </html>
מפרט
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'document.write(...)' in that specification. |
Living Standard | |
Document Object Model (DOM) Level 2 HTML Specification The definition of 'document.write(...)' in that specification. |
Obsolete |
תאימות דפדפן
The compatibility table on 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.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
write | Chrome
Full support
45
| Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android
Full support
45
| Chrome Android
Full support
45
| Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android ? |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- See implementation notes.
- See implementation notes.