javascript - 在javascript中单击按钮时如何显示模式?我需要一个例子,谢谢
问题描述
在javascript中单击按钮时如何显示模式?我需要一个例子,谢谢
解决方案
而不是使用警报,您将需要寻找像https://micromodal.now.sh/这样的模态库或构建自己的。
document.getElementById("myButton").addEventListener("click", function(){
alert("World");
})
<button id="myButton">
Hello
</button>
推荐阅读
- mysql - 在 sql 查询中使用 IF 语句时出错
- apache - .htaccess 文件以阻止除 4 之外的所有 IP,并始终允许向 /api/ 请求所有人
- javascript - JavaScript 正则表达式仅在字符仅出现时才匹配,后跟字母数字字符
- mysql - 错字3:mysql数据库不可用
- ios - 如何在 swift 中检查 nil 变量并避免应用程序崩溃?
- powershell - PowerShell - 从 Windows 到 Unix 的文件传输
- python-3.x - 找不到使用 python 程序创建的 postgres 表
- python - Elasticsearch query: syntax for range restriction gives 400
- python - Extract departure and arrival from a list
- sonarqube - SonarQube, Unit test coverage and integration test coverage separately