您可以从www.jquery.com下载jQuery库的副本,或者作为替代方案,您可以从CDN(如Google或Microsoft)中包含该副本。
我们将使用官方jQuery网站上的CDN。
要开始使用jQuery,我们首先需要使用脚本标记将其添加到HTML文档的头部:
<!DOCTYPE html>
<html>
<head>
<title>页面标题</ title>
<script src =“https: //code.jquery.com/jquery-3.1.1.js“> </ script>
</ head>
<body>
</ body>
</ html>
<html>
<head>
<script [space] =“jquery.js“> </ script>
</[space]>
<body>
</ body>
</ html>