基础
开心果
这个作者很懒,什么都没留下…
展开
-
全选,反选,全不选
$(function(){ //全选 $("#quanxuan").click(function(){ $(":checkbox").each(function(){ $(this).attr(“checked”,true); }) }) //全不选 $("#quanbuxuan").click(function(){ $(":checkbox").each(function(){ $(this)...原创 2019-03-25 17:05:14 · 114 阅读 · 0 评论 -
**#批量删除**
function piliang(){ var ids = ""; //先获取到所有选中的复选框 $(":checkbox:checked").each(function(){ ids += ","+this.value; // ,1,2,3 拼接 }) ids = ids.substring(1); //1,2,3 截取 alert(...原创 2019-03-25 16:59:20 · 153 阅读 · 0 评论 -
计算字符串出现的次数
方法一: String str = “北京市人民政府和北京市政协”; // 定义一个子串 String s = “北京”; // 统计次数 int count = 0; while (true) { // 返回第一次出现子串的索引 int index = str.indexOf(s); if (index!= -1) { str = str.substring(index + s.length()...原创 2019-03-28 11:54:59 · 3351 阅读 · 1 评论