鼠标事件

HTML中鼠标各种事件详细解答

<html>
	<script>
		function a(){
            //点击后隐藏
			document.getElementById("b").style.display="none";
			
		}
	</script>
	<body>
		<div id="b" style="width:100px;height:200px;background-color:yellow" onclick="a()"></div>
	</body>
</html>

运行结果为:HTML中鼠标各种事件详细解答

点击后黄色框消失

其他鼠标事件使用类似,只是功能稍有些不同

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-22
  • 2021-11-04
相关资源
相似解决方案