为什么结果显示jquery呢,不应该是javascript吗?我这哪里错了?
function get_previousSibling(n){
var z=n.previousSibling;
while(z && z.nodeType!=1){
z=z.previousSibling;
}
return z;
}
var a=document.getElementsByTagName("li")[2];
document.write("<br/>"+a.nodeName);
document.write(" = ");
document.write(a.innerHTML);
var b=get_previousSibling(a);
if(b!=null){
document.write("<br/>previoussibling:");
document.write(b.nodeName);
document.write(" = ");
document.write(b.innerHTML);
}
else{
document.write("<br/>已经是最前一个节点");
}