摘要: 一、类的操作 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> .b1{ width: 100px; height: 100px; background-color: red; } .b2{ /* 阅读全文
posted @ 2021-05-06 18:01 hapuluosi 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 一、键盘事件 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> window.onload = function(){ // 键盘事件 // 1.o 阅读全文
posted @ 2021-04-29 17:45 hapuluosi 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 一、事件的冒泡 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> #box1{ width: 300px; height: 300px; background-color: gold; } #s1 阅读全文
posted @ 2021-04-28 17:59 hapuluosi 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 一、操作内联样式 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> #box1{ width: 150px; height: 150px; background-color: red; } </s 阅读全文
posted @ 2021-04-27 17:37 hapuluosi 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 一、正则表达式 <script type="text/javascript"> // 语法: // var 变量 = new RegExp("正则表达式","匹配模式"); // 使用typeof检查正则对象,会返回object // var reg = new RegExp("a");这个正则表达 阅读全文
posted @ 2021-04-26 19:00 hapuluosi 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 一、Date对象 <script type="text/javascript"> // Date对象 // 在js中使用Date对象来表示一个时间 // 创建一个Date对象 // 如果直接使用构造函数创建一个Date对象,则会封装为当前代码执行的时间 var d = new Date(); con 阅读全文
posted @ 2021-04-25 15:07 hapuluosi 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 一、forEach <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> // forEach() 需要一个函数作为参数 // IE8及以下的浏览器不支 阅读全文
posted @ 2021-04-23 17:56 hapuluosi 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 一、flex属性: 1.flex-direction 值:row(默认值):主轴为水平方向,起点在左端 row-reverse:主轴为水平方向,起点在右端 column:主轴为垂直方向,起点在上沿 column-reverse:主轴为垂直方向,起点在下沿 2.flex-wrap 值:nowrap(默 阅读全文
posted @ 2021-04-22 18:05 hapuluosi 阅读(1139) 评论(0) 推荐(0) 编辑
摘要: 一、数组 <script type="text/javascript"> // 四个方法: // 1.push()可以向数组末尾添加一个或多个元素,并返回新的数组长度 // 可以将要添加的元素作为方法的参数传递 // 这样的元素将会自动的添加到数组的末尾 // 2.pop()可以删除数组的最后一个元 阅读全文
posted @ 2021-04-22 17:21 hapuluosi 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 一、作用域 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> // 作用域:指每一个变量的作用的范围 // 在js中一共有两种作用域: //1.全局 阅读全文
posted @ 2021-04-21 17:51 hapuluosi 阅读(52) 评论(0) 推荐(0) 编辑