JavaScript方法:if(document.getElementById('id')!=null){alert('存在')}jQuery方法:if($('#id').length>0){alert('存在')}