()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  

תאימות דפדפן

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge ? Firefox Full support YesIE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

ראה גם

Document Tags and Contributors

Contributors to this page: fabio.rahamim
Last updated by: fabio.rahamim,