asp.net.ph

Skip Navigation Links

swapNode Method

DHTML Methods


Exchanges the location of two objects in the document hierarchy.

Syntax

object.swapNode ( oNode ) 
Parameters

oNode Required. Specifies an element.

Return Value

No return value.

Example

The following sample demonstrates the use of the swapNode method to exchange the location of two objects.

<script language="JavaScript">
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 ( ) ">


© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note