javascript check if element is not null