If you want to use pure JavaScript instead of jQuery, try this:
<form><textarea id="ta"></textarea></form>
<script type="text/javascript">
jah = "whatever you want";
var ta = document.getElementById('ta');
ta.value = jah;
</script>
Assigning .value
equals jQuery function .val(v);
$('#myinput').val($('#example').find('p').text());
where 'myinput' is id of your textarea. Paste this line after
document.getElementById("example").innerHTML=jah;
just like this using jQuery's val method $('#Id').val(jah);
Where Id is the id of input for textarea. :)
By using $.val. Assuming #example
is a selector pointing to the input field in question, you can use something like this:
$('#example').val(jah);