2010-01-15 要素の種類を調べる JavaScript alert( document.getElementById("hoge").nodeName ); テキストボックス等なら"INPUT"が、spanタグなら"SPAN"が返る。