Board Thread:Support Requests - Getting Technical/@comment-3271569-20131223152502

I'm currently working on an add class table tab system for w:c:dragoncity:Eggs. I managed to code an raw sample for it. And I was wondering if you have some suggestions how I could improve it.

JS
")     var countEggs = $('table#unbreedable-' + name + ' tr.' + name + "-" + val).length;   for ( var i = 1; i < countEggs / 4; i++ ) {         $("table#unbreedable-" + name + "-" + val + " tr").append(" ")      }   }); /* Eggs page- 2# Tab Action */   var elem = "terra";   $(".tab-" + name + "-" + elem + ".tab-0").click(function{      $("table#unbreedable-" + name + "-" + elem + " td").removeClass("active");      $(".tab-" + name + "-" + elem + ".tab-0").addClass("active");      $("tr." + name + "-" + elem).removeClass("active");      $("tr." + name + "-" + elem + ".content-0").addClass("active");   });   $(".tab-" + name + "-" + elem + ".tab-1").click(function{      $("table#unbreedable-" + name + "-" + elem + " td").removeClass("active");      $(".tab-" + name + "-" + elem + ".tab-1").addClass("active");      $("tr." + name + "-" + elem).removeClass("active"); $("tr." + name + "-" + elem + ".content-1").addClass("active"); });  $(".tab-" + name + "-" + elem + ".tab-2").click(function{ $("table#unbreedable-" + name + "-" + elem + " td").removeClass("active"); $(".tab-" + name + "-" + elem + ".tab-2").addClass("active"); $("tr." + name + "-" + elem).removeClass("active"); $("tr." + name + "-" + elem + ".content-2").addClass("active"); });  $(".tab-" + name + "-" + elem + ".tab-3").click(function{ $("table#unbreedable-" + name + "-" + elem + " td").removeClass("active"); $(".tab-" + name + "-" + elem + ".tab-3").addClass("active"); $("tr." + name + "-" + elem).removeClass("active"); $("tr." + name + "-" + elem + ".content-3").addClass("active"); });  $(".tab-" + name + "-" + elem + ".tab-4").click(function{ $("table#unbreedable-" + name + "-" + elem + " td").removeClass("active"); $(".tab-" + name + "-" + elem + ".tab-4").addClass("active"); $("tr." + name + "-" + elem).removeClass("active"); $("tr." + name + "-" + elem + ".content-4").addClass("active"); }); });

CSS
 