Exportar (0) Imprimir
Expandir Todos
go
Expand Minimize
EN
Este conteúdo não está disponível no seu idioma mas aqui tem a versão em inglês.

compareDocumentPosition method

Compares the position of two nodes in a document.

Document Object Model (DOM) Level 3 Core Specification, Section 1.2Internet Explorer 9

 

Syntax

object.compareDocumentPosition(otherNode)

Parameters

otherNode [in]

Type: IHTMLDOMNode

The node to be compared to the reference node, which is the node executing the method.

Return value

Type: Number

Describes how the position of the node specified by the otherNode parameter relates to the position of the reference node. The return value contains one or more of the following flag values:

Return valueDescription
0x01

The nodes are disconnected.

0x02

The position of the node specified by the otherNode parameter precedes the position of the reference node.

0x04

The position of the node specified by the otherNode parameter follows the position of the reference node.

0x08

The reference node contains the node specified by the otherNode parameter.

0x10

The node specified by the otherNode parameter contains the reference node.

0x20

The node positions depend on the DOM implementation and cannot be compared.

 

Standards information

Remarks

For information about the factors that affect the position of nodes within the DOM, see the Document Object Model (DOM) Level 3 Core Specification from the World Wide Web Consortium (W3C).

Windows Internet Explorer 9. The compareDocumentPosition method is supported only when webpages are displayed in IE9 Standards mode.

See also

a
applet
attribute
audio
button
div
document
documentType
frame
iframe
img
input type=button
input type=checkbox
input type=email
input type=file
input type=hidden
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
label
legend
marquee
media
object
optGroup
option
ProcessingInstruction
select
source
span
table
textArea
TextNode
video

 

 

Mostrar:
© 2014 Microsoft