Document getElementById check if not null

less than 1 minute read

Document getElementById check if not null

Check if element is not null.

var element = document.getElementById('something');
if (element != null && element.value == '') {
}

Leave a comment