摘要: 对象的原型是构造函数的原型 构造函数原型:prototype 对象的原型__proto__ 原型链的终止 console.dir(People.prototype.__proto__.__proto__) console.dir(stu.__proto__.__proto__.__proto__._ 阅读全文
posted @ 2021-11-17 20:17 嘎嘣脆儿 阅读(31) 评论(0) 推荐(0)
摘要: $(function(){ $(".c_add").click(function(){ var val= $("#count-ipt").val(); var num= parseInt(val)+1; var count= $(".in-count").text() if(num<=count) 阅读全文
posted @ 2021-11-16 20:38 嘎嘣脆儿 阅读(38) 评论(0) 推荐(0)
摘要: 定时器 setInterval 用法 setInterval(()=>{ next(); },3000); top切换: $(this).addClass("active").siblings().removeClass("active"); $(".top ul").eq($(this).inde 阅读全文
posted @ 2021-11-15 18:16 嘎嘣脆儿 阅读(1683) 评论(0) 推荐(0)
摘要: DOM操作: 内部插入=>子节点 append appendTo 在所有子元素后面追加内容 $(".append").click(function(){ $(" <li>列表a</li>").appendTo($("ul")) }) prepend 在所有子元素前面添加内容 $(".prepend" 阅读全文
posted @ 2021-11-11 11:45 嘎嘣脆儿 阅读(36) 评论(0) 推荐(0)
摘要: 基本事件: click 点击事件 mousemove 鼠标移动 hover 鼠标放上去有样式 事件冒泡: 从自己逐级往父元素找 stopPropagation 阻止事件冒泡 preventDefault 阻止默认行为 reset submit a[href]都带有默认行为 阅读全文
posted @ 2021-11-10 11:38 嘎嘣脆儿 阅读(18) 评论(0) 推荐(0)
摘要: attr(属性名) 获取属性值 attr(属性名,属性值) 没有参数时获取 ,带参数时设置 html 获取div<span>span</span>包含html标签的元素 text 获取纯文本 var 获取交互控件(表单控件)的值 在设置的时候,html会解析其中的标签 , text不会解析,只是原样 阅读全文
posted @ 2021-11-09 20:54 嘎嘣脆儿 阅读(32) 评论(0) 推荐(0)
摘要: jQuery的三种写法: 1)$(document).ready(function(){ }) 2)$().ready(function(){ }) 3)$(function(){ }) window.onload=function(){}=onload=function(){} alert=>wi 阅读全文
posted @ 2021-11-08 14:24 嘎嘣脆儿 阅读(29) 评论(0) 推荐(0)
摘要: 获取元素的方式: document.getElementById(); document.getElementsByClassName(); document.getElementsByName(); document.getElementsByTagName(); document.querySe 阅读全文
posted @ 2021-11-05 17:33 嘎嘣脆儿 阅读(38) 评论(0) 推荐(0)
摘要: 正则表达式 var reg1=/\d/; var reg2=new RegExp("\d");//对象的方式 小写 \d \D大写取反,任意一个非数值 \d 匹配的是0-9任意数字 [] 匹配的是其中的任意一个字符(数字和其它特殊符号) [0-9]\d 12=>[12] 匹配的是1或2 12=>[1 阅读全文
posted @ 2021-11-04 17:35 嘎嘣脆儿 阅读(26) 评论(0) 推荐(0)
摘要: js的基本语法 <a href="#">建立锚点,在此页面跳转</a> <a href="javascript:void(0)">空链接</a> js的基本语法 //number 数值 整数和小数 // string 字符串 (字符) // bool true/false // null 没有 // 阅读全文
posted @ 2021-11-02 17:32 嘎嘣脆儿 阅读(39) 评论(0) 推荐(0)