<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>不同方式js导入</title>
</head>
<script>
function onclick_1() {
alert("内嵌式触发警告");
}
</script>
<script src="作业2025_2_22_5.js"></script>
<body bgcolor="#5F6297">
<div style="text-align: center">
<button
style="
background-color: #4caf50;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border: none;
border-radius: 12px;
"
onclick="alert('行内式触发警告')"
>
行内式
</button>
</div>
<div style="text-align: center">
<button
style="
background-color: #4caf50;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border: none;
border-radius: 12px;
"
ondblclick="onclick_1()"
>
内嵌式
</button>
</div>
<div style="text-align: center">
<button
style="
background-color: #4caf50;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border: none;
border-radius: 12px;
"
onmouseout="onclick_2()"
>
引入外部式
</button>
</div>
</body>
</html>
//作业2025_2_22_5.js
function onclick_2() {
// 弹出一个警告框
alert("引入外部式触发警告");
}