Last active
November 18, 2016 18:23
-
-
Save imkost/e083d7e9ac8db22eb8f0171da16963cf 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
function NameEditor({ instanceIndex }) { | |
return ` | |
<div class="nameEditor"> | |
<div>Enter you name:</div> | |
<input onKeyUp="NameEditor.onKeyUp(this, ${instanceIndex})" /> | |
<div> | |
Hello, <span id="nameEditor__name-${instanceIndex}"></span> | |
</div> | |
</div> | |
`; | |
} | |
NameEditor.onKeyUp = (input, instanceIndex) => { | |
document.getElementById(`nameEditor__name-${instanceIndex}`).innerText = input.value; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment