Visit Mozilla.org

DOM:document

MDC

« Gecko DOM ReferenceDOM에서 document objectHTML, XHTML, 그리고 XML 문서들을 표현하는 일반적인 방식을 제공합니다. Document objects는 일반적인 DOM Core document 인터페이스를 구현하고 있습니다.

일반화된 DOM Core document 인터페이스와 마찬가지로, HTML documents 또한 DOM HTMLDocument 인터페이스를 구현하고 있습니다. 이것은 HTML documents (e.g., document.cookie, document.alinkColor)를 다루기 위해 좀 더 특별히 구현된 인터페이스입니다. 특별히 구현된 인터페이스에 포함되는 속성들(properties)과 메서드들은 별표(*) 표시를 해 두었습니다.

Document 객체는 window 객체에 포함되며, 특정 엘리먼트들(elements)를 포함하고 있습니다.

Document 인터페이스는 문서 유형(document type), 색깔, 그리고 포멧, 플러그인들, 애플릿들과 같은 곳으로 접근할 수 있는 방법을 제공합니다. 또한 document의 자식 노드(node) 혹은 엘리먼트들(elements), 예를 들면 BODY와 TABLE과 같은 엘리먼트들을 생성하고 관리하도록 메서드도 제공하고 있습니다.

[편집] Properties

document.alinkColor* Deprecated
document body의 active link들의 색깔을 설정하거나 설정되어 있는 값을 리턴합니다.
document.anchors*
anchors document에 있는 anchor들의 전체 목록을 리턴합니다.
document.applets*
applets document에 있는 애플릿들의 정렬된 목록을 리턴합니다.
document.bgColor* Deprecated
bgColor 현재 document의 배경 색깔을 설정하거나 설정되어 있는 값을 리턴합니다.
document.body*
body 현재 document의 BODY 노드를 리턴합니다.
document.characterSet
document에서 사용하고 있는 문자셋(character set)을 리턴합니다.
document.compatMode*
Indicates whether the document is rendered in Quirks or Strict mode.
document.contentType
현재 document의 MIME Header의 Content-Type을 리턴합니다.
document.cookie*
Returns a semicolon-separated list of the cookies for that document or sets a single cookie.
document.defaultView
Returns a reference to the window object.
document.designMode*
designMode gets/sets WYSYWIG editing capability of Midas. 이것은 오직 HTML 문서에만 사용할 수 있습니다.
document.doctype
현재 문서의 Document Type Definition (DTD)을 리턴합니다.
document.documentElement
Returns the Element that is a direct child of document. HTML 문서에서는 일반적으로 HTML 엘리먼트가 됩니다.
document.domain*
domain 현재 document의 도메인을 리턴합니다.
document.embeds*
embeds 현재 document 내에 있는 embedded OBJECTS의 목록을 리턴합니다.
document.fgColor* Deprecated
fgColor gets/sets the foreground color, or text color, of the current document.
document.firstChild
firstChild returns the first node in the list of direct children of the document. (See also firstChild for the general element property.)
document.forms*
forms 현재 document 내의 FORM 엘리먼트의 목록을 리턴합니다.
document.height*
height 현재 document의 높이를 설정하거나 설정된 값을 리턴합니다.
document.images*
images 현재 document에 있는 이미지의 목록을 리턴합니다.
document.implementation*
Returns the DOM implementation associated with the current document.
document.lastModified*
document가 가장 최근에 수정된 시간을 리턴합니다.
document.linkColor* Deprecated
document에 있는 하이퍼링크의 색깔을 설정하거나 설정된 값을 리턴합니다.
document.links*
document에 있는 하이퍼링크 전체의 목록을 리턴합니다.
document.location*
현재 document의 URI를 리턴합니다.
document.namespaceURI
현재 document의 XML namespace를 리턴합니다.
document.plugins*
사용할 수 있는 플러그인들의 목록을 리턴합니다.
document.popupNode
Returns the node upon which a popup was invoked (XUL documents only).
document.referrer*
Returns the URI of the page that linked to this page.
document.styleSheets*
현재 document 상의 stylesheet 객체들의 목록을 리턴합니다. on the current document.
document.title*
현재 document의 제목을 리턴합니다.
document.tooltipNode
현재 tooltip의 타겟(target)인 노드를 리턴합니다.
document.URL
현재 document의 URL에 포함되어 있는 문자열을 리턴합니다.
document.vlinkColor* Deprecated
방문한 하이퍼링크의 색깔을 설정하거나 설정되어 있는 값을 리턴합니다.
document.width*
현재 document의 너비를 리턴합니다.

[편집] Methods

document.clear* Deprecated
In majority of modern browsers, including recent versions of Firefox and Internet Explorer, this method does nothing.
document.close*
Closes a document stream for writing.
document.createAttribute
Creates a new attribute node and returns it.
document.createDocumentFragment
Creates a new document fragment.
document.createElement
Creates a new element with the given tag name.
document.createElementNS
Creates a new element with the given tag name and namespace URI.
document.createEvent
Creates an event.
document.createNSResolver
Creates an XPathNSResolver.
document.createRange
Creates a Range object.
document.createTextNode
Creates a text node.
document.createTreeWalker
Creates a TreeWalker object.
document.evaluate
Evaluates an XPath expression.
document.execCommand*
Executes a Midas command.
document.getElementById
Returns an object reference to the identified element.
document.getElementsByName
Returns a list of elements with the given name.
document.getElementsByTagName
Returns a list of elements with the given tag name.
document.getElementsByTagNameNS
Returns a list of elements with the given tag name and namespace.
document.importNode
Returns a clone of a node from an external document.
document.loadOverlay
New in Firefox 1.5 Loads a XUL overlay dynamically. This only works in XUL documents.
document.open*
Opens a document stream for writing.
document.queryCommandEnabled*
Returns true if the Midas command can be executed on the current range.
document.queryCommandIndeterm*
Returns true if the Midas command is in a indeterminate state on the current range.
document.queryCommandState*
Returns true if the Midas command has been executed on the current range.
document.queryCommandValue*
Returns the current value of the current range for Midas command. As of Firefox 2.0.0.2, queryCommandValue will return an empty string when a command value has not been explicitly set.
document.write*
Writes text to a document.
document.writeln*
Write a line of text to a document.