swapNode method

This topic has not yet been rated - Rate this topic

Exchanges the location of two objects in the document hierarchy.

Syntax

object.swapNode(otherNode)

Parameters

otherNode [in]

Type: IHTMLDOMNode

Object that specifies the existing element.

Return value

Type: IHTMLDOMNode

Returns a reference to the object that invoked the method.

Standards information

There are no standards that apply here.

Remarks

This method is accessible at run time. If elements are removed at run time, before the closing tag is parsed, areas of the document might not render.

Examples

This example uses the swapNode method to exchange the location of two objects.


<SCRIPT>
function fnSwap(){
   oList.children(0).swapNode(oList.children(1));
}
</SCRIPT>
<UL ID = oList>
  <LI>List Item 1
  <LI>List Item 2
  <LI>List Item 3
  <LI>List Item 4
</UL>
<INPUT TYPE = button VALUE = "Swap List" onclick = "fnSwap()">

See also

a
abbr
address
area
attribute
article
aside
b
base
bdo
blockQuote
body
br
button
caption
cite
code
col
colGroup
comment
dd
del
div
dl
documentType
dt
em
embed
fieldSet
figcaption
figure
footer
form
head
header
hgroup
hn
hr
html
i
iframe
img
input type=button
input type=checkbox
input type=file
input type=hidden
input type=image
input type=password
input type=radio
input type=reset
input type=submit
input type=text
ins
kbd
label
legend
li
link
map
mark
nav
object
ol
option
p
pre
ProcessingInstruction
q
s
samp
script
section
select
small
span
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
title
tr
u
ul
var
Reference
cloneNode
removeNode
replaceNode
Conceptual
About the W3C Document Object Model

 

 

Build date: 11/28/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.