JS检测对像(支持多版本)
function myFunc(elemID){
var obj
if(document.all){
obj=document.all(elemID)
}else if(document.getElementById){
obj=document.getElementById(elemID)
}else if(document.layers){
obj=document.layers[elemID]
}
if(obj){
//statements that work on the object
}
}