Write about Document object in Java Script


Document object:

A.A document is a web page that is being either displayed or created. The document has a number of properties that can be accessed by java script programs and used to manipulate the content of the page.

Document object properties:

Property
Description
Example
AlinkColor
It is used to set and get color for a link
Document.alinkColor
Anchor
It is the object reference of an anchor contained in the document
Document.anchor
bgColor
It is used to set or get background color of web page
Document.bgColor
Cookie
It is used to identify the value of a cookie
document.cookie
Domain
It is used to get the domain name of the server from which document is loaded
document.domain
url
It is used to get the url string of current page or document
document.url
VlinkColor
It is used to get or set the visitedlinkColor
document.vlinkColor
Forms
It returns array of the object reference of a form object
document.forms
Image
It returns array of the object reference of an image object
document.image
Link
It is the object reference of a link object contained in the web page
document.link
linkColor
It is used to set or get color of a link attribute
document.linkColor
Lastmodified
It is used to get the time at which the document or web page was lost modified
document.lastmodified
Title
It is used to set or get title of document using java script
document.title



Methods
Method
Description
Example
Close()
Closes a document stream opened using document.open()
Document.close();
Open([mime type])
Open a document stream
Document.open();
Writeln(“string”)
Writes the given string on document with new line character at the end
Document.writeln(“hello”);
Write(“string”)
Writes the given string and document stream
Document.write(“hello”);
getElementById()
This methods returns the element that has the id attribute with the specified value
Document.getElementId(“demo”);

Related

How to Access Data Base from JSP Page?

In general if we want to interact with the data base from JSP page that we should use scripting elements where we should provide the required JDBC (Java data base connectivity code. The above app...

Explain the Difference Between Tables & Frames

Frames are simple, provide excellent navigation and highly popular. In fact many web surfers hate frame based sites because each frame takes up space on the visitor screen for border ...

What is a Protocol .Explain IP and TCP ?

Protocol  :  A  protocol  is  a  set of  rules  which govern  how computers  can   communicate.  (or) A  ...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item