```js
if ( !elem.parentNode ) {
  return null;
}
```