Create a new text document JsFirstDemo
Open the Edit and enter the following code
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>hello javascript</title>
</head>
<body>
<script language="javascript">
alert("I want you!");
</script>
</body>
</html>
Save and exit
then change the file extension .html
Now that we have completed
Next we choose a browser to open the file
The contents of the page that appears is what we have just written content
Above, we are in 页面中直接嵌入JavaScript代码
the next us 链接外部的JavaScript文件
to achieve
Also new text document function, and .html files in the same path
Open the file and enter the following code function
Save and exit
the function suffix to .js
like this
Modify the code following JsFirstDemo.html
Save and exit
and then file browser to open JsFirstDemo.html
After closing the box shells
Reproduced in: https: //www.jianshu.com/p/d5bbafadcff9