I can use this to set the value of the text area (selectedtext) on the form (submitquestion) if Firefox, but this does not work in IE.
document.submitquestion.selectedtext.value = txt;
This should work:
<textarea id="bla">from</textarea> <script type="text/javascript"> document.getElementById("bla").value = "test"; </script>
Try the following:
document.forms['submitquestion'].elements['selectedtext'].value = txt;
Assuming you have:
<form name='submitquestion'> <textarea name='selectedtext'></textarea> </form>
JQuery, .
$('#selectedtext').val('whatever');
javascript,
document.getElementById("myTextarea").value = txt;