I have an input:
<input type="text" value="value" id="textinput" />
and a picture:
<img src="folan.png" value="hi" id="hi" />
I want that when I click the image it adds text to the input value. How I can accomplish this with PrototypeJS or pure JavaScript?
I tried this code:
document.getElementById("hi").addEventListener('click', function () {
var text = document.getElementById('textinput');
text.text = (text.text + ' after clicking');
});