
jquery
宋同学灬
坚持不一定成功,但放弃一定失败!
展开
-
JS动态获取DIV的宽度和高度px!
JS动态获取div的宽度:var o = document.getElementById("div");var width= o.clientWidth||o.offsetWidth;console.log(width);JS动态获取div的高度同理:var o = document.getElementById("div");var height= o.clientHeight||o.offsetHeight;console.log(height);...原创 2021-01-14 09:38:19 · 4179 阅读 · 1 评论 -
用jQuery动态给class的元素绑定click、blur、keyup.....事件
在添加更多一行的时候所产生的 input 和 button 都是动态生成的,所以不能使用 click,要使用 live (jquery 1.7.2 之后的版本不建议使用 live) 或 oneg:把 $(".Btn").click(function(){}); 改为 $(".Btn").live("click",function(){});或者$(".Btn").on("click",funct...原创 2018-07-06 10:19:03 · 19556 阅读 · 0 评论