- 博客(3)
- 收藏
- 关注
原创 function函数与匿名函数
//普通function函数 var hi = function(){ alert("hello,world"); } hi(); //匿名函数 var hi2 = () => alert("hello,world"); hi2(); 匿名函数举例: const PI = 3.14; var area = r =>{return PI*r*r} document.write(area(7)); 输出结果为:153.86 同时也可以使用语句,例如: var max = (num1,n
2020-11-08 11:25:03
406
原创 JS单词大小写转换代码
<body> <input id="old"> <input type="button" value="转小写" id = "toLower" > <input type="button" value="转大写" id = "toUpper" > <input id="new"> <script> function toChange(opt){ //根据ID获取input标签 var input1 = docu
2020-11-06 09:13:40
584
原创 萌新初学JavaScript(笔记)
一.JS的“hello world”: <script type="application/JavaScript"> //控制浏览器弹出警告框 alert("控制浏览器弹出警告框"); //向页面(body)中输入内容 document.write("向页面(body)中输入内容"); //向控制台(console)中输入内容 console.log("向控制台(console)中输入内容"); </script> 二.JS编写位置: 1.可以将代码打在<titl
2020-11-03 21:49:50
171
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅