In javascript what is a web document and how do you write to

In javascript what is a web document and how do you write to one? Give me an example.

Solution

In java script web document is that when we put write() method or document.write on program .

for example

document.write(\"Hello World!\");

The document.writeln() method is similar to write(), only it adds a newline character after each statement.

The write() method writes HTML expressions or JavaScript code to a document.

The write() method is mostly used for testing: If it is used after an HTML document is fully loaded, it will delete all existing HTML.

JavaScript - Document Object Model or DOM. Every web page resides inside a browser window which can be considered as an object. A Document object represents the HTML document that is displayed in that window. ... The way a document content is accessed and modified is called the Document Object Model, or DOM.

The Document interface represents any web page loaded in the browser and serves as an entry point into the web page\'s content, which is the DOM tree. The DOM tree includes elements such as <body> and <table>, among many others. It provides functionality global to the document, like how to obtain the page\'s URL and create new elements in the document.

When you release a web page in your browser, the browser retrieve the page’s HTML text and parses it, much like the way our parser from  parsed programs. The browser builds up a model of the document’s structure and then uses this model to draw the page on the screen.

This symbol of the document is one of the toys that a JavaScript program has accessible in its sandbox. You can read from the model and also change it. It acts as a live data constitution: when it is modified, the page on the screen is efficient to return the changes.

In javascript what is a web document and how do you write to one? Give me an example.SolutionIn java script web document is that when we put write() method or d

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site