警报弹出窗口未显示 [英] Alert pop-up not showing

查看:132
本文介绍了警报弹出窗口未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用简单的代码找不到问题。按钮显示,但是当我点击它时,警告弹出窗口不显示。

I can’t find the problem with my simple code. The button shows, but the alert pop-up doesn’t show when I click on it.

我做错了什么?

<DOCTYPE! html>
<html>


<body>
<h1>This will be a test for Javascript</h1>
<button> onclick="myFunction()">I like it</button>

<script>
 function myFunction() {
     alert("are you sure?");
}
</script>
</body>
</html>

推荐答案

智能引号中的问题。
使用

Problem in smart quotes. Use


报价。

这篇关于警报弹出窗口未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆