jQuery and JavaScript: Check weather an Element exists

jQuery and JavaScript: Check weather an Element exists

JavaScript



if( document.getElementById('someID') === null ){
alert('doesnt exists');
}


jQuery



if( $('#someID').length == 0 ){
alert('doesnt exists');
}