Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### elementContains
|
||||
---
|
||||
title: elementContains
|
||||
tags: browser,intermediate
|
||||
---
|
||||
|
||||
Returns `true` if the `parent` element contains the `child` element, `false` otherwise.
|
||||
|
||||
@ -11,4 +14,4 @@ const elementContains = (parent, child) => parent !== child && parent.contains(c
|
||||
```js
|
||||
elementContains(document.querySelector('head'), document.querySelector('title')); // true
|
||||
elementContains(document.querySelector('body'), document.querySelector('body')); // false
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user