>// DOMアクセスで再帰的に配下のエレメントをたどる。 >// EVALの結果がemptyでなくなったらやめて結果として返す。 >Function SrchDomTree( elm, func ) > result = empty > // 先に直接の子ノードを調べる > for i = 0 to elm.childNodes.length > ret = eval(func) > ifb ret then > result = ret > exit > endif > next > // 孫ノードに入っていく > for i = 0 to elm.childNodes.length - 1 > ifb elm.childNodes[i].childNodes.length then > ret = SrchDomTree( elm.childNodes[i], func ) > ifb ret then > result = ret > exit > endif > endif > next >Fend