1 Star 0 Fork 0

oO风月笑平生Oo/huawei01

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
07js.html 809 Bytes
一键复制 编辑 原始数据 按行查看 历史
oO风月笑平生Oo 提交于 2024-10-10 20:14 +08:00 . 测试1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!-- html绑定函数:0级事件 -->
<button onclick="demo()">触发函数</button>
<button>触发函数</button>
<script>
//js的函数
// 1.使用关键字 function ==》 命名函数
// 2.使用变量定义函数
function demo(){
console.log('我是一个函数');
}
// 1.函数名+()调用
// demo();
// 2级事件
var btn = document.getElementsByTagName('button')[1];
console.log(btn);
btn.onclick = function(){
console.log('aaaa');
}
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zfg1122/huawei01.git
git@gitee.com:zfg1122/huawei01.git
zfg1122
huawei01
huawei01
master

搜索帮助