<div id="result"></div>
<div id="keyboard">
<span>q</span>
<span>w</span>
<span>e</span>
<span>r</span>
<span>t</span>
<span>y</span>
</div>
<script>
document.querySelector('#keyboard').addEventListener('click',function(event){
if(this!==event.target)
document.querySelector('#result').innerHTML+=event.target.innerHTML;
});
</script>