HTML事件
作者:互联网
窗口事件属性
onload加载完成 onunload 卸载完成
<body "console.log('加载完成') " "console.log('卸载完成')">
</body>
onfocus 聚焦 onblur失焦
<body "console.log('聚焦')" "console.log('失焦')">
</body>
onresize更改窗口大小
<body "console.log('更改了窗口大小')" >
</body>
表单事件
onfocus 聚焦 onblur失焦
<form action="#" method="get">
<input type="text" "console.log('聚焦了')" "console.log('失焦了')" />
<input type="submit" value=""/>
</form>
onchange 内容发生改变
<form action="#" method="get">
<input type="text" "console.log('值改变了')" />
<input type="submit" value=""/>
</form>
键盘事件
<body "console.log('按下了')">
</body>
<body "console.log('按着')">
</body>
<body "console.log('抬起了')">
</body>
鼠标事件
<span "console.log('单击')">测试文本</span>
<span "console.log('双击')">测试文本</span>
<span "console.log('鼠标进入')" "console.log('鼠标离开')">测试文本</span>
<span "console.log('按下鼠标')" "console.log('鼠标抬起')">测试文本</span>
<span "console.log('鼠标移动')" >测试文本</span>
<span onm ousewheel="console.log('鼠标转动滚轮')" >测试文本</span>
多媒体事件
<audio controls="controls" src="audio/02.mp3" "console.log('开始播放')" "console.log('暂停了')"
>
当前浏览器不支持audio
</audio>
标签:onblur,HTML,事件,测试,失焦,onfocus,文本 来源: https://blog.csdn.net/weixin_44606322/article/details/89259231