title: Error "Uncaught TypeError: Failed to execute 'animate' on 'Element': Valid arities are: [1], but 4 arguments provided." on dynamic input field
body: <p>I'm trying to create a form dynamically using jquery with the following code</p>
  
  <pre><code>function createFieldSet(dataArray) {
      var fieldset = $('fieldset');
  
      $.each(dataArray, function(key, value) {
          for(var key in value) {
              if (key.toLowerCase() === "other") {
                  fieldset.append($('&lt;button/&gt;').attr({ type: 'button', name:'btn_' + key, value: key}).on('click', 'textOther', function() {alert('click');}).html(value[key]));
                  fieldset.append($('&lt;input/&gt;').attr({ type: 'text', name:'textOther', value: ""}).hide);
              } else {
                  fieldset.append($('&lt;button/&gt;').attr({ type: 'button', name:'btn_' + key, value: key}).html(value[key]));
              }
  
              fieldset.append('&lt;br /&gt;');
          }
      });     
  }
  </code></pre>
  
  <p>but returns an error shown in the title, pointing to the second line that appends the input line, which I'm trying to have hidden on creation unless the button created above is clicked. Was wondering why I'd get something referring to animate when I didn't call such a function, and if this is fixable/doable....or if this should have been done in a server side language.</p>