I have to enable and disable the anchors based on index ,eg : when index is 3 or more > anchor should be disabled . I have written the following code snipet but the anchor is not getting disabled when index is 3 .
if(index == 3){
$("#anchor2").click(function(e){
e.preventDefault();
return false;
});
}