How to Add/Remove value from a list?
<p>I need to add and remove items from a list of integers.  There will be no repeats in the list. I will pass the list to a query and display the results.  Right now, I just need to be able to start with an empty list and as the user selects items, the list will be populated.  </p>

<p>The idea is that when a user clicks on the first time, the item will be bolded and its ID will be added to the list. The second time an item is clicked on, the item will be unbolded and the ID will be removed from the list.  Easy, right?</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function() {

    MyList = "";

$(".Cat").live("click", function() {
    CurrentClass = $(this).attr("class");
    // CLICKED
        if (CurrentClass == "Cat") {
        $(this).addClass("Bold");
            NewItem = $(this).attr("id");
            // ADD ITEM TO LIST
            MyList = 
        // UNCLICKED 
        } else {
        $(this).removeClass("Bold");
            NewItem = $(this).attr("id");
            // REMOVE ITEM FROM LIST
            MyList =   
    }
});

});
&lt;/script&gt;

&lt;span id="1" class="Cat"&gt;1&lt;/span&gt;

&lt;span id="2" class="Cat"&gt;2&lt;/span&gt;

&lt;span id="3" class="Cat"&gt;3&lt;/span&gt;
</code></pre>
