From c1a1380d8bf00da441c663544604bdee7fdb1ab5 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Sat, 6 Jan 2018 11:16:25 +0000 Subject: [PATCH] Travis build: 1055 --- README.md | 9 +++++---- docs/index.html | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3e9f2ee88..0c1b60618 100644 --- a/README.md +++ b/README.md @@ -1786,11 +1786,12 @@ copyToClipboard('Lorem ipsum'); // 'Lorem ipsum' copied to clipboard. ### 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 => { diff --git a/docs/index.html b/docs/index.html index 295d9e390..4e7fe2081 100644 --- a/docs/index.html +++ b/docs/index.html @@ -329,7 +329,7 @@ Object.assig } };
copyToClipboard('Lorem ipsum'); // 'Lorem ipsum' copied to clipboard. -
Creates an element from a 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.
const createElement = str => { +
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.
const createElement = str => { const el = document.createElement('div'); el.innerHTML = str; return el.firstElementChild;