如何判断一个对象的种类?比如是select或者input for(i=0;i<document.formName.elements.length;i++)alert(document.formName.elements[i].type) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.formName.elements[i].type is ok! <select id=s1><option>a</option></select><script>alert(s1.tagName);</script> for(i=0;i<document.formName.elements.length;i++)alert(document.formName.elements[i].tagName=="INPUT"?document.formName.elements[i].type:document.formName.elements[i].tagName) 求58同城和百姓网图片上传源码 jqGrid如何获取选中的多行记录? 第三次發問同一個問題...有人能回答嗎???(新手給不了分...) 在html文件中插入编号 关于onclick事件的问题 js循环显示对象id问题 层的移动,滚动问题?高分求救 用DIV和CSS来画矩形框出现的怪事 html中取后台值 急!如何判断客户端某一文件路径是否存在?(注意:是客户端路径的验证) javascript写的万能查询,请问怎么读出值 再次请教高手!怎样可以屏蔽掉网页对话框的关闭按钮?急!谢谢!
<option>a</option>
</select>
<script>
alert(s1.tagName);
</script>
alert(document.formName.elements[i].tagName=="INPUT"?document.formName.elements[i].type:document.formName.elements[i].tagName)