jquery / javascript not picking up value on click
<p>I need to dynamically alter a variable with the "name" attribute from a link - code below...</p>

<pre><code>       &lt;input type="text" class="datepicker" id="dp1"&gt;

       &lt;a href="javascript:;" class="tab" name="1,2"&gt;test button&lt;/a&gt;
</code></pre>

<p>and</p>

<pre><code>$(document).ready(function(){

    var pickable = { dp1: [4,5,6] };

    $(".tab").click(function () { 
        var test = $(this).attr("name").split(",");
        pickable = { dp1:  test  };
    });

    $(".datepicker").each(function() {
        $(this).datepicker({
            beforeShowDay: function(date){ 
                var day = date.getDay(), days = pickable[this.id];
                return [$.inArray(day, days) &gt; -1, ""];
            },
        });
    });

});​
</code></pre>

<p>Any ideas why this doesn't work??</p>
