SyntaxFix
Write A Post
Hire A Developer
Questions
Try getting the element with the ID and check if the return value is null:
document.getElementById('some_nonexistent_id') === null
If you're using jQuery, you can do:
$('#some_nonexistent_id').length === 0