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:   
  • 相关阅读:
    How ASP.NET MVC Works?[持续更新中…]
    PortalBasic Web 应用开发框架
    .NET性能分析最佳实践之:如何找出使用过多内存的.NET代码(基础篇)
    js模块化开发js大项目代码组织和多人协作的解决之道
    PortalBasic Web 应用开发框架:应用篇(二) —— Action 使用
    细细品味Hadoop_Hadoop集群(第2期)_机器信息分布表
    msmvps.comblogs
    敏捷开发中编写故事应该符合的条件
    自己动手重新实现LINQ to Objects: 12 DefaultIfEmpty
    我的时间管理——充分利用WindowsPhone、Android等设备,实现真正的无压工作!
  • 原文地址:https://www.cnblogs.com/joeylee/p/3028166.html
Copyright © 2011-2022 走看看