Created
December 5, 2016 19:42
-
-
Save imkost/b0de13d91429010cdff0a4e966da1ab2 to your computer and use it in GitHub Desktop.
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 characters
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; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment