The following small series will provide you with a detailed explanation of the jquery traversal array each method. I think this is quite good. Now I will share it with you and give you a reference. Let's take a look at JQuery's method of getting objects.
$ ('# Id'): the id of an element.
$ ('Tagname'): The Tag Name of the element.
$ ('Tagname tagname'): Use the Tag Name of the element. For example: $ ('ul li ')
$ ('Tagname # id): uses the element id and tag signature.
$ (': Checkbox'): obtains all elements whose input type is checkbox:
Eg:
$ ('Span [price] input [type = text] '): retrieves the following input element.$ ('P', $ (this ). parents ('P: first '): gets the first p node on the p (at least the parent node) $ ('~ Span: first ', this): locates the first sibling of this that's a element.
Delayed loading of js files:
$. GetScript
Example:
Html file:
Java code
$. GetScript Example