<html>
   <head>
      <title></title>
   </head>
   <body>
      <a href="#" id="anchor">aaa<br>aaa<br>aaa<br></a>
   </body>
<script>
function handleTextNode() {
   var obj = document.getElementById("anchor");
   var textObj = obj.childNodes;   var length = textObj.length;   
   for ( i = 0; i < length; i++  ) {
       itemObj = textObj[i];
       if(typeof(itemObj.innerHTML)!="undefined")
       {
  alert('其它类型的结点') ;
   }else
       {
  alert('文本结点');
       }     
}}
handleTextNode()
</script>
</html>