ノードリストの判定?

フォームの中の要素を集めて、ノードリストなのか、要素なのかを判断するのに.length だけを見ていたら、select でつまずいた。
模索中。

しかも、es = select要素
es = [es];
es にはオプションが。

臨時解決策として

  if (es.nodeType == 1)
    es = [].concat (es);
if (typeof el.length == 'number' && typeof el.item == 'function' && typeof el.nextNode == 'function' && typeof el.reset == 'function') { alert("I'm a NodeList"); }