for (var K=0; K<10; K++){
  if(typeof(document.getElementById("iWhere"+K))=="undefined") //"iWhere"+K可能是一个文本框的ID
      alert("kkkkkkkkkkkkkkllll");
}