zoukankan      html  css  js  c++  java
  • jQuery如何动态删除TR,input按钮删除本行记录,checkbox全选反选

    checkbox 全选反选

     1:  var i = 1;
     2:          function CheckAllTeacher() {
     3:              if (i % 2 == 1) {
     4:                  i++;
     5:                  $("#sendContent input[type='checkbox']").attr("checked", true);
     6:              } else {
     7:                  i++;
     8:                  $("#sendContent input[type='checkbox']").attr("checked", false);
     9:              }
    10:   
    11:          }
    12:   

    input按钮删除本行记录(Jquery动态删除tr)

    1:  <a href='javascript:deleteSmg("<%#(Eval("Templateid").ToString())%>")' title="点击删除"><img border=0"" src="../skin/images/de.png" height="20" width="20"/></a>
    2:  
     1:  function deleteSmg(id) {
     2:              if (confirm("是否真的删除?")) {
     3:                  $.ajax({
     4:                      type: "POST",
     5:                      url: "DeleteSmg.ashx",
     6:                      data: "smgId=" + id + "&t="+Math.random(),
     7:                      success: function (msg) {
     8:                          $("#content" + id).closest("tr").remove();
     9:                      }
    10:                  });
    11:   
    12:              } else {
    13:                  alert("不删除");
    14:              }
    15:          }
    16:   
  • 相关阅读:
    Codeforces 946D
    Codeforces 817F
    Codeforces 931F
    Codeforces 932D
    Graph HDU
    Chef and Graph Queries CodeChef
    Lucky Array Codeforces
    Calculation 2 HDU
    洛谷 P3455 [POI2007]ZAP-Queries || 洛谷P2522,bzoj2301
    洛谷 P2398 GCD SUM || uva11417,uva11426,uva11424,洛谷P1390,洛谷P2257,洛谷P2568
  • 原文地址:https://www.cnblogs.com/joeylee/p/3028166.html
Copyright © 2011-2022 走看看