1 What is jquery:
jquery is to encapsulate some methods in a JS file. It's a JS library.
We learn these methods.
2 Why to learn jquery:
Native JS has the following issues:
1. Compatibility issues
2. Code duplication
The method name provided by 3.DOM is too long and difficult to remember
4. Poor code tolerance
5. The entry function can only have one, if there are multiple, the back will overwrite the front
3
jquery Version Description:
Large version; 1 2 3 1 compatible IE6, 7, 8 2 3 incompatible
Small version: Compressed version (used in production) No comment No line break no space variable name is a B c D This mode is particularly small
Uncompressed version (used in development environment) Notes are especially clear and clear format
4$ Essence
$ (selector) Selector
$ (domobj) Convert DOM objects to jquery objects
The second notation of the $ (function) entry function
$===jquery
5jQuery objects and Dom objects:
jquery object: The jquery method gets the element that is the jquery object
The jquery object is the wrapper set (pseudo-array) of the DOM object
Dom object: The element that the JS method gets is the DOM object
jquery Object Goto DOM Object
Jqueryobj[index]
Jqueryobj.get (Index)
Dom object to jquery object (Money will do)
$ (domobj)
5 Some selectors::
5.1 Basic selector: ID selector $ ("#id名")
Class Selector $ (". ClassName")
TAB selection period $ ("TagName")
and the set selector $ ("Selector1,slector2 ...")
Intersection selector $ ("Selector1selector2 ...")
5.2 Level Selector
Descendant selector $ ("Selector1 selector2 ....")
Descendant Selection period $ ("SELCTOR1>SELECTOR2> ...")
5.3 Filter Selector
$ ("Selector:filter")
$ ("selector:odd") odd filter Selector
$ ("Selector:even") even filter selector
$ ("Selector:eq (Index)") Ordinal filter Selector
5.4 Filter Selector
Is the method
Jequryobj.children ("selector") sub-element filtering
Jequryobj.parent () parent element
Jequryobj.siblings ("selector") sibling element filter
Jequryobj.next (); next element
Jequryobj.find ("selector") descendants filter
JEQURYOBJ.EQ (index) Number filter
What is jquery $ jquery object and Dom object and some selectors