Value change on check/uncheck w/ jQuery
<p>I'm trying to switch the var "act" withing my function dynamically. I looks OK, but for some reason I keep on getting  the same <strong>act</strong> whether I check the checkbox or uncheck it... Can someone please take a look and see what I'm missing here?</p>

<pre><code>$(".chkbx").change(function() {
    if($(this).attr("checked", true)) {
        var act = "remFromSessionSingleID";
    } else {
        var act = "addToSessionSingleID";
    }

    SelectedContactsInSession(act, $(this).val());          
});

function SelectedContactsInSession(act, id) {           
    $.ajax({
        url: "actions.php",
        type: "POST",
        data: "op="+act+"&amp;contID="+id
    });
}
</code></pre>
