title: Repeat a div when clicking a button
body: <p>The below code is for repeating a div. But it does not work. Please help me.</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;script&gt;
        $(".repeat").live('click', function () {
          var $self = $(this);
          $self.after($self.parent().clone());
          $self.remove();
        });
    &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;form&gt;
        &lt;div class="repeatable"&gt;
          &lt;table border="1"&gt;
          &lt;tr&gt;&lt;td&gt;&lt;input type="text" name="userInput[]"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
          &lt;button class="repeat"&gt;Add Another&lt;/button&gt;
        &lt;/div&gt;
      &lt;input type="submit" value="Submit"&gt;
      &lt;/form&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>