javascript check if element exists in dom