JavaScript Reference/Javascript Methods/swapNode — различия между версиями
(нет различий)
|
Версия 21:30, 25 мая 2010
"swapNode()" Example
<source lang="javascript">
<html> <body> <script language="JavaScript"> function function1() {
if (document.all) { var myNew = document.createElement("div"); myNew.innerText = "This is a swapped element" myNew.style.color = "red" myDiv.swapNode(myNew); }
} </script>
<input type="button" value="SwapNode" onClick="function1();"> </body> </html>
</source>
"swapNode()" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | |<address> <applet> | | |<area> | | |<base> <basefont> | | | <bgsound> |
| ||| |<body>
| | |<button>| | | | | |
| |<col> | | |<colgroup> <comment> | | |
| | | <dir> ||
| |
- | | |<embed> <fieldset> | | | <form> | | |<frame> <frameset> | | |<head> <hn> | | |
<html> || | <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"> | | | <label> |
| |<legend>- | | |<link> <listing> | | |<map> <marquee> | | |<menu> <object> | | |
<option> | | |
<plaintext> | | |
| | || | |<script> <select> | | | | | || | | | | |<tbody> | | |
<textarea> | | |<tfoot> | | |<thead> <title> |
| || | | | | | <xmp> | +----------------+--------------------------------------------------------------+ </source>
"swapNode()" Syntax, Parameters and Note
<source lang="javascript"> Note: Swaps two nodes.
Syntax:
textNodeName.swapNode(param1) Parameters: param1 Required; one of the two nodes to exchange positions.
</source>