我如何在網頁中初始化 jQuery?
在網頁中初始化 jQuery 非常容易。你可以嘗試執行以下程式碼,瞭解如何在網頁中初始化 jQuery。我們使用 Google CDN 來新增 jQuery。Microsoft CDN 也可用於將 jQuery 庫新增到 HTML 中。
示例
<html>
<head>
<title>jQuery Function</title>
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("div").click(function() {alert("Welcome to Tutorialspoint!");});
});
</script>
</head>
<body>
<div id = "mydiv">
Click on this to see a dialogue box.
</div>
</body>
</html>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP