Basically all I’m trying to do is if one check box is selected by the user, then automatically check the previous box. Each check box has an iterating number id. So for example if checkbox id=3 is selected then auto select check box id=2. Here’s my code below:
<script>
var $j = jQuery.noConflict();
$j('input:checkbox').click(function()
{
if (this.checked)
{
var original = $j(this).attr("id");
var temp = original - 1;
var follower = $j(temp);
follower.attr("checked",true);
}
});
</script>
This doesn’t do anything at all. Can someone help tell me what’s wrong or if there’s a better way to do this that would be awesome! Thanks!
How about