swapNode method
[This documentation is preliminary and is subject to change.]
Exchanges the location of two objects in the document hierarchy.
Syntax
object.swapNode(otherNode)Standards information
There are no standards that apply here.
Parameters
- otherNode [in]
-
Type: IHTMLDOMNode
Object that specifies the existing element.
Return value
Type: ObjectReturns a reference to the object that invoked the method.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
- Attr Constructor
- a
- abbr
- acronym
- address
- applet
- area
- attribute
- article
- aside
- b
- base
- baseFont
- bdo
- bgSound
- big
- blockQuote
- body
- br
- button
- caption
- center
- cite
- code
- col
- colGroup
- comment
- dd
- del
- dfn
- dir
- div
- dl
- documentType
- dt
- em
- embed
- fieldSet
- figcaption
- figure
- font
- footer
- form
- frame
- frameSet
- 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
- listing
- map
- mark
- marquee
- menu
- nav
- nextID
- object
- ol
- option
- p
- plainText
- pre
- ProcessingInstruction
- q
- s
- samp
- script
- section
- select
- small
- span
- strike
- strong
- sub
- sup
- table
- tBody
- td
- textArea
- tFoot
- th
- tHead
- title
- tr
- tt
- u
- ul
- var
- xmp
- Element Constructor
- HTMLDocument Constructor
- Text Constructor
- Reference
- cloneNode
- removeNode
- replaceNode
- Conceptual
- About the W3C Document Object Model
Build date: 2/14/2012