Home >Web Front-end >JS Tutorial >How to use jquery

How to use jquery

anonymity
anonymityOriginal
2019-05-07 14:10:118076browse

How to use jquery: First download the jquery file from the official website and put it into the project; then on the page, use "

How to use jquery

First, quote jquery on the page

1. Download jquery. Download address: http://hovertree.com/hvtart/bjae/b8627323101a4994.htm, one is a compressed version and the other is an uncompressed version. If you are in the development and testing stage, you can use the uncompressed version. In actual applications, the compressed version is generally used (min )

Then quote it on the page.

<script type="text/javascript" src="./jquery/jquery-1.11.3.min.js"></script>

2. Quoting the online jquery file

The code is as follows:

<script type="text/javascript" src="http://hovertree.com/ziyuan/jquery/jquery-1.11.3.min.js"></script>

Related topic recommendations: "jq tutorial"

Then, use jquery to operate the dom and add dynamic effects.

Next you can use the powerful functions of jQuery. For example, set the links on the page to be red.
The code is as follows:

<!DOCTYPE html>
<html xmlns=" 
<head>
<title>jQuery改变链接的颜色</title>
<base target="_blank" />
    <script type="text/javascript" src=" </script>
</head>
<body>
    <a href="#">首页</a> 
     <a href="#">参考</a>
     <br/>
     注意本页上链接的颜色
     <script>
         $(document).ready(function () { 
             $("a").css("color", "red"); 
         );
     </script>
 </body>
 </html>

The above is the detailed content of How to use jquery. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn