alert的使用方法

先说alert的使用范畴:

alert("内容");可以在有“<script></script>”标签内,只要有这个标签就可以有alert();

这个标签可以在“<head></head>”内,可以在“<body></body>”中还可以在*.js文件中!

来个实例:

<html>
<head>
<Script Language="JavaScript">
alert("hello word!");
</Script>
</head>
</html>

保存成任意名.html保存就可以看到效果了,alert中的字符串填入你要提示的内容,
eg:
alert("你要提示的内容!");
只要点击确认,程序就可以继续执行了,如果不点击,程序就不执行

猜你喜欢

转载自blog.csdn.net/weixin_42419856/article/details/81122840
今日推荐