title: jQuery strip HTML all forms
body: <p>I want to have a generic .js file which, for each <code>form</code> it encounters on a page, on submit, it strips HTML from all <code>textarea</code>, <code>input</code> and <code>select</code> elements. I feel like I'm missing a basic trick.</p>
  
  <pre><code>$("form").each(function() {
      $(this).find(':input')
      if (!isNaN(this.value)) {
          this.value = this.value
              .replace(/&amp;/g, "&amp;amp;")
              .replace(/&lt;/g, "&amp;lt;")
              .replace(/&gt;/g, "&amp;gt;")
              .replace(/"/g, "&amp;quot;")
              .replace(/'/g, "&amp;#039;");
      }
  });
  </code></pre>