★ wanayoo — archive 1999 http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/swapNode.aspNouvelle recherche | Portail wanayoo
MSDN Online Web Workshop   All Products  |   Support  |   Search  |   microsoft.com Home  
microsoft.com Home
  HOME  |   VOICES  |   LIBRARIES  |   COMMUNITY  |   DOWNLOADS  |   SITE GUIDE  |   SEARCH MSDN
 
Click to return to the DHTML, HTML & CSS home page  
submit Method     tags Method     DHTML Methods    
Web Workshop  |  DHTML, HTML & CSS

swapNode Method


Exchanges the location of two objects in the document hierarchy.

Syntax

oSwapped = object.swapNode(oNode)

Parameters

oNodeRequired. Object that specifies the existing element.

Return Value

Returns 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.

Example

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()">

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, HEAD, 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, MARQUEE, MENU, NEXTID, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XMP



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.