diff --git a/snippets/createElement.md b/snippets/createElement.md index f3cfa7cd8..cad69bb01 100644 --- a/snippets/createElement.md +++ b/snippets/createElement.md @@ -1,10 +1,11 @@ ### createElement -Creates an element from a string. +Creates an element from a string (without appending it to the document). +If the given string contains multiple elements, only the first one will be returned. -Use `document.createElement()` to create a new element. Set its `innerHTML` -to the string supplied as the argument. Use `ParentNode.firstElementChild` to -return the element version of the string. +Use `document.createElement()` to create a new element. +Set its `innerHTML` to the string supplied as the argument. +Use `ParentNode.firstElementChild` to return the element version of the string. ```js const createElement = str => {