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>