function onclick(){ var text = document.getElementById('comment').value + ' :)'; document.getElementById('comment').value = text; }