title: Changing textarea wrapping using javascript
body: <p>For my small wiki application, I mostly need to have the textarea used to edit the contents to use soft (or virtual) wrapping. However, in some cases, not wrapping the content would be preferable. I thought I would do this by simply having a button to turn off wrapping. Here is the simplified code:</p>
  
  <pre><code>  &lt;form name="wikiedit" action="[[script_name]]" method="post"&gt;
      &lt;textarea name="content" rows="25" cols="90" wrap="virtual"&gt;[[content]]&lt;/textarea&gt;
      &lt;input type="button" onclick="document.wikiedit.content.wrap='off';" value="No Wrap"&gt; &amp;nbsp;
      &lt;input type="submit" value="Save"&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>It works with IE, but not with Firefox or Opera. How should I do this?</p>