Jquery ??????????????????????, Jquery

Source: Internet
Author: User

Jquery ??????????????????????, Jquery

  

What is the difference between jquery and javascript?

JavaScript is a scripting language that is mainly used in browsers to perform operations on document objects on webpages and process user interaction actions.
JQuery, however, is a JavaScript code library (or a library used to be called a class library). It brings together functions that are frequently used in JavaScript development for developers to use directly, instead of using native JavaScript statements to write a large amount of code, you can achieve consistent results across different browsers. Is one of the most popular JavaScript libraries.

1. jQuery, as a JavaScript code base, is naturally written in JavaScript.
2. jQuery code is very standard and highly efficient in execution. It is an excellent example of JavaScript code.
3. In many cases, most JavaScript functions can be implemented by using jQuery.

PS: for example, the program language is a raw material, the code library is a semi-finished product made of raw materials, and your program project is a finished product. You can choose to directly use raw materials or add some semi-finished products. Of course, you can use raw materials more freely, while using semi-finished products is more efficient.

What is the difference between empty () and html ("") in jquery?

Empty (), html (""), and text ("") are the same When deleting the content in the matching element. JQuery source code has different implementations, but the effects are the same. You can test it.
Source code:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "www.w3.org/..al.dtd">
<Html xmlns = "www.w3.org/5o/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Script src = "../scripts/jquery-1.4.2.min.js" type = "text/javascript"> </script>
<Script>
$ (Function (){
$ ('# BtnEmpty'). click (function (){
$ ('# Aim'). empty ();
Alert ("empty ()");
});
$ ('# BtnHtml'). click (function (){
Certificate ('%aim'%.html ("");
Alert ('html ("")');
});
$ ('# Btntext'). click (function (){
$ ('# Aim'). text ("");
Alert ('text ("")');
});
});

</Script>
</Head>

<Body>
<Div id = "aim">

<Ul>
<Li> 111111111 </li>
<Li> 222222222 </li>
<Li> 333333333 </li>
<Li> 444444444 </li>
</Ul>

</Div>
<Button id = 'btnempty '> empt ...... remaining full text>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.