Manipulating list items with jQuery
<p>I am currently trying to manipulate a unordered list with jQuery, essentially I have a list of links in an unordered list, certain users only have access (all set server side) to certain files / pages.</p>

<p>I was hoping to use some jQuery to remove a few list items from the DOM, simply because it's more appealing to me to not have the user click on a link, load the page and then be displayed an error because they have insufficient access. </p>

<p>I already have an object setup, and have successfully removed one standalone link from the DOM, although I can't seem to get the selector right to remove the list items. </p>

<p>List HTML:</p>

<pre><code>&lt;div id="browse" class="bubble"&gt; 
&lt;blockquote&gt;
&lt;ul id="browses"&gt;
&lt;li&gt;&lt;a href="browse.php?id=15" class="browse"&gt;Access&lt;/a&gt;&lt;br /&gt;&lt;/li&gt; //trying to remove
&lt;li&gt;&lt;a href="browse.php?id=1" class="browse"&gt;Accounts&lt;/a&gt;&lt;br /&gt;&lt;/li&gt; //trying to remove
&lt;li&gt;&lt;a href="browse.php?id=2" class="browse"&gt;Browse's&lt;/a&gt;&lt;br /&gt;&lt;/li&gt; //trying to remove
&lt;li&gt;&lt;a href="browse.php?id=7" class="browse"&gt;Commands&lt;/a&gt;&lt;br /&gt;&lt;/li&gt; //trying to remove
&lt;li&gt;&lt;a href="browse.php?id=4" class="browse"&gt;Content&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="browse.php?id=8" class="browse"&gt;Logs&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="browse.php?id=10" class="browse"&gt;Sessions&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="browse.php?id=11" class="browse"&gt;Settings&lt;/a&gt;&lt;br /&gt;&lt;/li&gt; //trying to remove
&lt;li&gt;&lt;a href="browse.php?id=12" class="browse"&gt;Sites&lt;/a&gt;&lt;br /&gt;&lt;/li&gt; //trying to remove
&lt;/ul&gt;   
&lt;/blockquote&gt;
&lt;cite&gt;Browse and manage the currently active sites data&lt;/cite&gt;
&lt;/div&gt;
</code></pre>

<p>Object thus far:</p>

<pre><code>Session = function(){
    this.init(phpdev_session);
}

$.extend(Session.prototype, {
    // object variables
    vars: '',

    init: function(phpdev_session){
        // do initialization here
        this.vars = phpdev_session;
    },

    restrict: function() {
     if (this.vars.account_class == '40') {
      //access client or less, remove manage another site link and a few browses from #browse ul
      //note: its all restricted server side, so its just a presentation layer.
      $('a#activate').remove();
      $('#browses').remove('li:eq(0)').remove('li:eq(1)').remove('li:eq(2)').remove('li:eq(3)').remove('li:eq(7)').remove('li:eq(8)');
     }
    }
});

$(document).ready(function() {
    var session = new Session(phpdev_session);
    session.restrict();
});
</code></pre>
