1. 瀏覽器搜尋 jQuery官網

  2. 點選DownLoad jQuery

  3. Download the compressed, production jQuery 3.6.4

  4. Download the uncompressed, development jQuery 3.6.4

  5. 存放在本地端的JavaScript資料夾

  6. 於HTML檔案的</body>標籤前面,引入jQuery檔案

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>
       
        
        <script src="JS/jquery-3.6.4.min.js"></script>   //引入的 jQuery 檔案在這裡,注意路徑
    </body>
    </html>
    
  7. 於css資料夾內創建一個all.js,用來撰寫jQuery語法,然後將它引入HTML檔案內

    $(document).ready(function () {
        // jQuery 語法
    });
    

  8. 總結 :

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="css/style.css">
        <title>Document</title>
    </head>
    
    <body>
        <h1>1234</h1>
     
        <script src="js/jquery-3.6.4.min.js"></script>  **//載入jQuery (本地端) 檔案,下載好的**
        <script src="js/all.js"></script>  **//載入需要撰寫的jQuery檔案**
    </body>
    
    </html>