alert的使用方法

时间:2025-01-22 13:50:17

先说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("你要提示的内容!");
只要点击确认,程序就可以继续执行了,如果不点击,程序就不执行