Get values from multiple inputs jQuery
<p>Can someone please let me know how to get values from several input fields?
I have a list with several inputs like this:</p>

<pre><code>&lt;li&gt;
&lt;label&gt;Additional Title: &lt;/label&gt;&lt;input type='text' name='additionaltitlename' ... /&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;label&gt;Additional Title: &lt;/label&gt;&lt;input type='text' name='additionaltitlename' ... /&gt;
&lt;/li&gt;
</code></pre>

<p>I have a pretty similar thing written on Javascript (on form submit):</p>

<pre><code>...
var extratitles = document.getElementsByName('additionaltitlename'); 
var str = '';
      for (var i = 0; i &lt; extratitles.length; i++) { 
      str = str + '|' + extratitles.item(i).value;
    } 
}
</code></pre>

<p>But now I need to write same thing on jQuery, as before form submit I need to make a preview (post it through ajax and get HTML response).
I tried to combine it with jQeury like this:</p>

<pre><code>$('#getpreviewbutton').click(function(){

 // and paste here the javascript code from above:
    var extratitles = document.getElementsByName('additionaltitlename'); 
    var str = '';
          for (var i = 0; i &lt; extratitles.length; i++) { 
          str = str + '|' + extratitles.item(i).value;
        } 
    }

});
</code></pre>

<p>but it's probably wrong, as it's not working for me.
I guess I just need to know how to get the array of elements in jQuery and how to work with them through loop, will figure out the rest.</p>
