js判断对象是否存在
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>javascript object</title>
<body>
<input id="aaa">
<input type=buttonvalue="checkaaa">
<input type=buttonvalue="checkother">
<script language="javascript">
<!--
function check(strObj)
{
if(typeof(eval("document.all."+strObj))!= "undefined")
{
alert(strObj +" is an object");
}
else
{
alert(strObj +" is not an object");
}
}
//-->
</script>
</body>
页:
[1]