title: using jquery append() to add a button to a form
body: <p>I need to add a button to a form.  I have no control over the logic that creates the form itself... but i can add code around the form, if need be.</p>
  
  <p>The code for the form looks like this: </p>
  
  <pre><code>&lt;form action="/cgi-bin/a/logon" method="POST"&gt;
       &lt;DT&gt;Login ID&lt;/DT&gt;
         &lt;DD&gt;
            &lt;input class=" text" type="text"  name="id"  value=""&gt;
         &lt;/DD&gt;
       &lt;DT&gt;Password&lt;/DT&gt;
         &lt;DD&gt;
            &lt;input class=" password" type="password"  name="password"  value=""&gt;
         &lt;/DD&gt;
         &lt;DT&gt;&lt;/DT&gt;
         &lt;DD&gt;&lt;input class="submit" type="submit" name="submit" value="Logon"&gt;
        &lt;/DD&gt;
  &lt;/FORM&gt;
  </code></pre>
  
  <p>I know I can add a div around the entire form and append to that... but I would like the new button to appear right beside the "Logon" button.
  I've tried the following code, but it didn't work: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $(document).ready(function() {
             $('.submit').append($('&lt;input type="button" value="test"&gt;'));
          });
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm assuming you probably can't append to a button... which is why it didn't work.</p>
  
  <p>I'm still learning jquery so if there's another method aside from append that I could use, I'm all ears!  Actually, the button doesn't have to be a part of the form because I'm going to run client side code when it is clicked.  But it does have to appear beside the login button. </p>
  
  <p>Thanks. </p>