现在,在我们的head部分中有jQuery库并定义了文档ready(准备就绪)事件,我们可以开始我们的第一个jQuery操作!让我们改变div元素的内容。
html
<html>
<head>
<title>Page Title</title>
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
</head>
<body>
<div id="start">开始</div>
</body>
</html>
js代码
$(function() {
$("#start").html("奋斗");
});