function get_previousSibling(n){
var aa = n.previousSibling;
while(aa&&aa.previousSibling != 1){
aa = aa.previousSibling;
}
alert(aa.nodeName+"-------"+aa.innerHTML+"<br />");
return aa;
}
var m = document.getElementById("f");
document.write("<br />" + m.nodeName + "=" + m.innerHTML);
var u = get_previousSibling(m);
if(u!=null){
document.write("<br /> previousSibling:" + u.nodeName + "=" + u.innerHTML);
}else{
document.write("<br />这已经是第一个节点!");
}
while(aa&&aa.nodeType !=1) 判断的是节点类型
if(u.nodeType!=null) 判断的是节点类型