View Single Post
Old 12-16-2012, 10:47 PM   PM User | #3
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 454 Times in 452 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
generally not a good idea to have IDs starting with numbers, but if you were to go that way you could reduce your entire jQuery to:
Code:
$(document).ready( function() {
        $('a').click(function () {            
        var cb='#'+this.className.substr(-1); 
        $(cb).attr("checked", !$(cb).is(':checked'));
        }); 
    });
xelawho is offline   Reply With Quote