<SCRIPT>
function fnClone(){
/* the 'true' possible value specifies to clone
the childNodes as well.
*/
var oCloneNode = oList.cloneNode(true);
/* When the cloned node is added,
'oList' becomes a collection.
*/
document.body.insertBefore(oCloneNode);
}
</SCRIPT><UL ID = oList>
<LI>List node 1
<LI>List node 2
<LI>List node 3
<LI>List node 4
</UL><INPUT
TYPE="button"
VALUE="Clone List"
onclick="fnClone()"
>
function fnClone(){
/* the 'true' possible value specifies to clone
the childNodes as well.
*/
var oCloneNode = oList.cloneNode(true);
/* When the cloned node is added,
'oList' becomes a collection.
*/
document.body.insertBefore(oCloneNode);
}
</SCRIPT><UL ID = oList>
<LI>List node 1
<LI>List node 2
<LI>List node 3
<LI>List node 4
</UL><INPUT
TYPE="button"
VALUE="Clone List"
onclick="fnClone()"
>
要求用JS按不同的关键字对全部结果排序,所以要在不同的表之间交换行,用cloneNode()已经解决了。有没有更好的排序方法?