You can use JQuery for this purpose
$(document).ready(function () {
$('#<%=checkbox.ClientID %>').change(function () {
var optId = $(this).siblings("a").attr('id');
alert(optId);
});
});
OR
$(document).ready(function(){
$("input[type=checkbox]").change(function(){
if($(this).is(":checked")){
var id = $(this).siblings("a").attr('id');
alert(id);
}else{
alert("Unchecked")
}
});
});
});