摘要:
3. document: 浏览器文档对象 1) 根据标签id获取标签对象: let tag = document.getElementById("idName"); 2) 根据标签名获取标签数组: let tags = document.getElementsByTagName("标签名"); 3) 阅读全文
posted @ 2022-04-11 17:08
小小程序猿level1
阅读(39)
评论(0)
推荐(0)
摘要:
<body> <!--isNan判断内容是否符合数值格式--> <div> 请输入数值:<input type="text" name="num"> </div> <hr> <div id="show"></div></body><script> //为num标签绑定失焦事件 //获取标签 let 阅读全文
posted @ 2022-04-11 17:03
小小程序猿level1
阅读(34)
评论(0)
推荐(0)
摘要:
<head> <meta charset="UTF-8"> <title>5.定时器</title></head><body> <div id="show">0</div> <hr> <div> <input type="button" value="开始" onclick="toStart()"> 阅读全文
posted @ 2022-04-11 16:43
小小程序猿level1
阅读(25)
评论(0)
推荐(0)
摘要:
<head> <meta charset="UTF-8"> <title>3,open和close函数</title></head><body> <!--open作用 通常情况下与超链接效果相同, 但为了避免多次打开一个网页,就要给这个要打开的网页设置一个别名,也就是open的第二个参数 --> < 阅读全文
posted @ 2022-04-11 16:39
小小程序猿level1
阅读(50)
评论(0)
推荐(0)
摘要:
<div> <input type="button" onclick="jump('http://www.baidu.com')" value="百度"> <input type="button" onclick="jump('2.location.html?username=asde&passwo 阅读全文
posted @ 2022-04-11 16:07
小小程序猿level1
阅读(29)
评论(0)
推荐(0)
摘要:
BOM: Browser Object Model, 浏览器对象模型. 对应浏览器的js内置对象: window 1. history: 浏览器历史对象 1) back(): 后退一个页面 2) forward(): 前进一个页面 3) go(参数): 参数表示前进或者后退的页面数量: 正整数: 前 阅读全文
posted @ 2022-04-11 14:32
小小程序猿level1
阅读(69)
评论(0)
推荐(0)
摘要:
@charset "UTF-8";*{margin: 0;padding: 0}.box{ width: 50px; height: 10px;}.box1{ width: 100px; height: 100px; background-color: red; margin: 50px auto; 阅读全文
posted @ 2022-04-11 14:21
小小程序猿level1
阅读(51)
评论(0)
推荐(0)
摘要:
<head> <meta charset="UTF-8"> <title>js函数</title></head><body> <!-- 函数: 相当于java的方法 声明函数的语法(3种): 1. 显式声明: 语法: function 函数名(形参列表){ //函数体代码 } 使用: 函数名(实参) 阅读全文
posted @ 2022-04-11 12:01
小小程序猿level1
阅读(31)
评论(0)
推荐(0)
摘要:
</head><body> <script> //1,Math工具 var num = parseInt(Math.random()*100)+1 document.write(num+"<br>"); document.write("<hr>"); //2,String var num2 = "a 阅读全文
posted @ 2022-04-11 00:11
小小程序猿level1
阅读(29)
评论(0)
推荐(0)
浙公网安备 33010602011771号