O valor da transferência li.html
A cópia do código é a seguinte:
<! Doctype html>
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text/html; charset = utf-8"/>
<title> Troque o valor de Li </title>
<script type = "text/javascript">
window.onload = function () {
var lis = document.getElementById ("Ullist"). ChildNodes;
for (var i = 0; i <lis.length; i ++) {
var myli = lis [i];
// julga se é uma tag
if (myli.nodeType == 1) {
// Mudar de localização com um LI abaixo
myli.onClick = function () {
if (this.nextElementsibling) {
var nextli = this.nextElementsibling; // Isso só pode ser usado aqui, não myli
document.getElementById ("Ullist"). InsertBefore (Nextli, isso);
}
};
}
}
}
</script>
</head>
<Body>
<ul id = "ullist">
<li> Pequim </li>
<li> Shanxi </li>
<li> Shanghai </li>
<li> Tianjin </li>
<li> Henan </li>
</ul>
</body>
</html>