Is if(document.getElementById('something')!=null) identical to if(document.getElementById('something'))?

Viewed 167639

When I want to check if an element exists in a page. Are these two checks the same? Is there a better more compact way to check the existence?

What if I want to check if the value == ''. Can this be included in this check as well?

7 Answers
Related