jQuery(document).ready(function() { function do_zebra(){ jQuery('.form-table tr:nth-child(4n+3)').css({"background" : "#F1F1F1"}); jQuery('.form-table tr:nth-child(4n+4)').css({"background" : "#F1F1F1"}); } do_zebra(); jQuery('input#condition-add-new').parent().parent().css({"background" : "white"}); jQuery('#condition-add-new').click(function(){ //count rows in a .form-table minus last row with the button var sets = jQuery('.form-table tr input[id$="-code"]').length; var rows = '