text: $(function ($) {
      $(document).on("click", "#addRow", function () {
          var table = document.getElementById("emptbl");
          var rowCount = table.rows.length;
          var cellCount = table.rows[0].cells.length;
          var row = table.insertRow(rowCount);
          for (var i = 0; i <= cellCount; i++) {
              var cell = "cell" + i;
              cell = row.insertCell(i);
              var copycel = document.getElementById("col" + i).innerHTML;
              cell.innerHTML = copycel;
              if (i == 3) {
                  var radioinput = document.getElementsByTagName("select");
                  for (var j = 0; j <= radioinput.length; j++) {
                      if (radioinput[j].type == "radio") {
                          var rownum = rowCount;
                          radioinput[j].name = "gender[" + rownum + "]";
                      }
                  }
              }
          }
      });
  
      $(document).on("click", "#deleteRow", function () {
          var table = document.getElementById("emptbl");
          var rowCount = table.rows.length;
          if (rowCount > "2") {
              var row = table.deleteRow(rowCount - 1);
              rowCount--;
          } else {
              alert("There should be atleast one row");
          }
      });
  });
  
  