Last active
November 18, 2016 18:22
-
-
Save imkost/212c50e1400e9315643ab85d61981f05 to your computer and use it in GitHub Desktop.
This file contains 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() { | |
return ` | |
<div class="nameEditor"> | |
<div>Enter you name:</div> | |
<input onKeyUp="NameEditor.onKeyUp(this)" /> | |
<div> | |
Hello, <span></span> | |
</div> | |
</div> | |
`; | |
} | |
NameEditor.onKeyUp = (input) => { | |
input.nextElementSibling.querySelector('span').innerText = input.value; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment