Created
December 5, 2016 19:42
-
-
Save imkost/b0de13d91429010cdff0a4e966da1ab2 to your computer and use it in GitHub Desktop.
Revisions
-
K. Zemtsovsky created this gist
Dec 5, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ const nameElems = {}; function getNameElems(id) { return nameElems[id] || ( nameElems[id] = document.getElementsByClassName(`nameEditor__name-${id}`) ); } NameEditor.onKeyUp = (input, id) => { for (const elem of getNameElems(id)) { elem.innerText = input.value; } };