How to add List items in jQuery?
<p>I have the following code:</p>

<pre><code>if (option.generatePagination) {
    elem.append('&lt;ul class=' + option.paginationClass + '&gt;&lt;/ul&gt;');
    control.children().each(function () {
        $('.' + option.paginationClass, elem).append('&lt;li&gt;&lt;a href="#' + number + '"&gt;' + (number + 1) + '&lt;/a&gt;&lt;/li&gt;');
        number++;
    });
} else {
    $('.' + option.paginationClass + ' li a', elem).each(function () {
        $(this).attr('href', '#' + number);
        number++;
    });
}
$('.' + option.paginationClass + ' li:eq(' + start + ')', elem).addClass('current');
$('.' + option.paginationClass + ' li a', elem).click(function () {
    if (option.play) {
        pause();
    }
</code></pre>

<p>I'd like to add <code>&lt;li class="prev"&gt;&lt;a href=""&gt;Previous&lt;/a&gt;&lt;/li&gt;</code> as the first list item, and <code>&lt;li class="next"&gt;&lt;a href=""&gt;Next&lt;/a&gt;&lt;/li&gt;</code> as the last list item.</p>

<p>So:</p>

<pre><code>&lt;ul&gt;
&lt;li class="prev"&gt;&lt;a href=""&gt;Previous&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#' + number + '"&gt;' + (number + 1) + '&lt;/a&gt;&lt;/li&gt;
&lt;li class="next"&gt;&lt;a href=""&gt;Next&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>How could i do this? Thank you.</p>
