Having Issue on Using a Loop Inside a jQuery .each()
<p>I have two arrays as <code>state</code> and <code>memlist</code> and as you can see I am loading the elements of <code>memlist</code> to <code>#list</code> ul. This is working by using the <code>.each()</code> function but I still need to load the elemnt of <code>state</code> as a class defintion into <code>&lt;li&gt;</code>s like following:</p>

<pre><code>memlist.append($( '&lt;li class="'+ state[i] +'"&gt;' + value + '&lt;/li&gt;' ));
</code></pre>

<p>can you please let me know how to do this in jQuery?</p>

<pre><code>var memlist = $( "#list" );

var states = ['one','two','three'];
var members = [ "John", "Steve", "Ben", "Damon", "Ian" ];
$.each(members,function( index, value ){
  memlist.append($( "&lt;li&gt;" + value + "&lt;/li&gt;" ));
});
</code></pre>

<p>Thanks</p>