Thursday, May 2, 2013

Document Object Pada Java Script

Document Object
Setiap dokumen HTML dimuat ke dalam jendela browser menjadi objek Dokumen.Obyek Dokumen menyediakan akses ke semua elemen HTML dalam sebuah halaman, dari dalam script.
Tip: Obyek Dokumen juga merupakan bagian dari objek Window, dan dapat diakses melalui properti window.document.


W3C: W3C Standard.

Document Object Properties

Property Description W3C
anchors Returns a collection of all the anchors in the document Yes
applets Returns a collection of all the applets in the document Yes
body Returns the body element of the document Yes
cookie Returns all name/value pairs of cookies in the document Yes
documentMode Returns the mode used by the browser to render the document No
domain Returns the domain name of the server that loaded the document Yes
forms Returns a collection of all the forms in the document Yes
images Returns a collection of all the images in the document Yes
lastModified Returns the date and time the document was last modified No
links Returns a collection of all the links in the document Yes
readyState Returns the (loading) status of the document No
referrer Returns the URL of the document that loaded the current document Yes
title Sets or returns the title of the document Yes
URL Returns the full URL of the document Yes

Document Object Methods

Method Description W3C
close() Closes the output stream previously opened with document.open() Yes
getElementsByName() Accesses all elements with a specified name Yes
open() Opens an output stream to collect the output from document.write() or document.writeln() Yes
write() Writes HTML expressions or JavaScript code to a document Yes
writeln() Same as write(), but adds a newline character after each statement Yes

No comments :

Post a Comment

Kebahagiaan sejati bukanlah pada saat kita berhasil meraih apa yg kita perjuangkan, melainkan bagaimana kesuksesan kita itu memberi arti atau membahagiakan orang lain.

Follower

Google+ Followers

Translator

English French German Japanese Korean Chinese Russian Spanish
India Saudi Arabia Netherland Portugal Italian Philippines Ukraina Norwegia
Powered by
Widget translator