if(document.formid.selectid)
alert("selectid在formid中");
else
alert("selectid不在formid中");
比较笨的一种想法,试试
alert("selectid在formid中");
else
alert("selectid不在formid中");
比较笨的一种想法,试试
解决方案 »
- 类似360的设置自动保存是如何实现的,写在哪个事件里比较好
- 有谁知道这javascript语句是什么意思
- jQuery UI的使用问题
- 请问这些有什么区别language="javascript",language="jscript",type="text/javascript",type="text/Jscript"
- ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●怎样证明这两个this是一样的?????????????
- 隐藏的iframe中,form的submit总是失败
- 请教高手,一奇怪的问题
- (急)那位高手能帮我改改代码,谢谢!
- 请会网页制作的高手帮忙,急!!
- 怎样在js或asp里边删除某一路径下的word文档
- 元素 对象 有什么区别,如如:TEXTAREA 元素 | textArea 对象
- 请教:提交等待的问题!!急~~~~
{
alert("属于form");
}
else
{
alert("属于document");
}
//在form中
else
//不在form中
2。刚才没有领会楼主的意思,jouwei(九维) 的方法基本正确,但需要调整一下,应该就可以满足搂住的需求了,此法适用未知formid的情况
if(document.getElementByID("selectid").form)
//ie里好像不支持getElementByID,可以用document.all("selectid")代替;
{
alert("属于form");
alert(document.getElementByID("selectid").form.length) //值为1
}
else
{
alert("属于document");
}