首页 > 解决方案 > 在javascript中单击按钮时如何显示模式?我需要一个例子,谢谢

问题描述

在javascript中单击按钮时如何显示模式?我需要一个例子,谢谢

标签: javascriptmodal-dialog

解决方案


而不是使用警报,您将需要寻找像https://micromodal.now.sh/这样的模态库或构建自己的。

document.getElementById("myButton").addEventListener("click", function(){
	alert("World");
})
<button id="myButton">
Hello
</button>


推荐阅读