How can I set the input value of a form in javascript?
<p>Suppose that I have defined a form (<code>my_form</code>) that has an input named <code>myInput</code>.  I would like to set the value of <code>myInput</code> to be <code>my_string</code>.  </p>

<pre><code>$('#my_form textarea[name=myInput]').value = my_string;
</code></pre>

<p>I've tried the above line, and this works for most browsers, but not for Opera/Safari.  I know it doesn't work for Opera/Safari because the line</p>

<pre><code>console.log($('#my_form textarea[name=myInput]').value + " was the string");
</code></pre>

<p>logs <code>undefined was the string</code> to the screen instead of the actual value of my_string (which is not undefined).</p>

<p>How can I achieve this for these browsers?</p>