Page is crashing if I call this method
<p>I am using this method to answer a form randomly  </p>

<pre><code>  $('table').filter(function () {
      return ($(this).find('input').size() &gt; 0);
  }).find('tr').each(function () {
      $(this).find('input').filter(function () {
          return (Math.round(Math.random()) == 1);
      }).each(function () {
          var typ = this.type;
          if (typ == 'checkbox' || typ == 'radio') {
              this.checked = true;
          }
          if (typ == 'select' || typ == 'select-one') {
              var value = $.map(this, function (elt, i) {
                  return $(elt).val();
              }).sort()[0];
              this.val(value);
          }
          if (typ = "text" || typ == "textarea") {
              $(this).val(Math.floor(Math.random() * 11));
          }
      });
  });
</code></pre>
