javascript dom 子要素リスト 要素数
 
childNodesプロパティ(当該ノードの子ノードの配列) - DOMリファレンス
ある要素のオブジェクト e と兄弟関係になっている(同じ階層になっている)、href属性を持つ要素を探して処理する例です。
var e1=e.parentNode;e1=e1.childNodes;var i=-1;while (++i<e1.length) {// 要素ノードでなければ弾く。if (e1[i].nodeType!=1) continue;// href属性を持っていないなら弾く。if (e1[i].getAttribute('href')=='') contiune;(必要な処理)}
