if(document.getElementById("id")){
alert('对象存在');
... ...
}
else{
alert('对象不存在');
... ...
}
参考传送门:https://segmentfault.com/q/1010000011586519
if(document.getElementById("id")){
alert('对象存在');
... ...
}
else{
alert('对象不存在');
... ...
}
参考传送门:https://segmentfault.com/q/1010000011586519