+
95
-

回答

很简单,判断length就可以了

if($('#testid').length>0) {
alert('页面中存在testid元素');
} else {
alert('页面中不存在testid元素');
}


网友回复

我知道答案,我要回答