2008-12-22 idが存在するかを調べる JavaScript if( document.getElementById("hoge") ) { alert("ある"); } else { alert("ない"); }