<!DOCTYPE html>
<html>
<head>
<title>jsl.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript">
function test(){
var i = 3;
alert(i);//alert的使用
i = true;
alert(i);
}
</script>
</head>
<body>
<!--
<script type = "text/javascript">document.write("Hello World!");</script>
<a href = "#" onclick = "alert('HelloWorld')">请单击</a>
-->
<input type = "button" value = "click me" onclick = "test();"/>
</body>
</html>
javascript中alert的最基本使用
最新推荐文章于 2025-11-11 22:31:24 发布
本文提供了一个简单的HTML页面示例,其中包含JavaScript代码用于演示如何在网页上弹出变量的值。通过两个不同的alert调用展示了如何声明并改变变量的数据类型。
1849

被折叠的 条评论
为什么被折叠?



