在Html中加入JavaScript

1. 加入JS

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TestJS</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<script type = "text/javascript">
	function init() {
		alert("Hello World!!!");
	}
	</script>
<body onload=init()>
</body>
</html>
 

2.

猜你喜欢

转载自samsongbest.iteye.com/blog/1725987