javascript check if document getelementbyid is null