Detailed parsing of functions and attributes commonly used in jquery _jquery

Source: Internet
Author: User
Tags getscript new set prev stub

Dom:
Attribute: Property
$ ("P"). addclass (style type defined in CSS); Add a style to an element
$ ("img"). attr ({src: "test.jpg", Title: "Test Image "}); Adds an attribute/value to an element, and the parameter is a map
$ ("input"). attr ({"Checked", "checked"});
$ ("img"). attr ("title", function () {return this.src}); add attribute/value
$ ("element name") to an element. html (); Gets the contents (elements, text, etc.) of the element
$ (" Element name "). HTML (" <b>new stuff</b> "); Sets the content
$ ("element name") for an element. Removeattr ("property name") deletes the specified property and the value of the property
$ ("element name") for an element. Removeclass ("class") deletes the specified style
$ ("" Element name "). Text (); Gets the text
$ ("element name") of the element. Text (value), set the literal value of this element to be values
$ ("element name"). Toggleclass (Class) If the element exists in the parameter's style, it is canceled, if it does not exist, set this style
$ ("INPUT element name"). Val (); Gets the value of the INPUT element
$ ("INPUT element name"). val (value); Set the value of the INPUT element to

Manipulation:
$ ("element name"). After (content); Add content after a matching element
$ ("element name"). Append (content); Inserts content as an element into the back of the element
$ ("element name"). Appendto (content); To connect elements after content
$ ("element name"). before (content); Contrary to the After method
$ ("element name"). Clone (Boolean expression) when a Boolean expression is true, the clone element (when no argument is treated as true)
$ ("element name"). Empty () sets the content of the element to null
$ ("element name"). InsertAfter (content); After the element is inserted into the content
$ ("element name"). InsertBefore (content); Before inserting the element into the content
$ ("element"). prepend (content); Place the content as part of the element and put it at the front of the element
$ ("element"). Prependto (content); Take the element as part of the content and place the top of the content
$ ("element"). Remove (); Delete all the specified elements
$ ("element"). Remove ("exp"); Delete all elements that contain exp
$ ("element"). Wrap ("HTML"); Surround the element with HTML
$ ("elements"). Wrap (Element); Use element to surround the elements

Traversing:
Add (expr) The current matching element set adds a new set of matching elements ' expr ' to form a new set of matching elements;

Example:

Copy Code code as follows:

$ (document). Ready (function () {
$ ("div"). CSS ("Border", "2px solid Red")
The P element in the. Add ("P")/document applies the background color to the yellow CSS style;
. CSS ("Background", "yellow");
});

Children (expr) obtains a set of first-level subsets of each element from the collection of the current matching elements, forming a new set of elements
Contains (str) matches the collection of elements that contain the variable text of STR, which returns a collection of matching elements
End () is used to return to the JQuery object before the find () or parents () function (or other traversal function) is invoked

Example
$ ("#div1"). Find ("P"). Hide (). End (). Hide ()
The first hide () is returned to the #div1 label for the p tag and then ends with the reference to the P tag
So the second hide () is the one that works for #div1.
If you do not add end (), then two hide () will work on the P tag

Filter (expression)
Find (expr)
The difference between filter and find:
The filter will be selected within a set of selected elements;
Find will be selected within a set of child nodes of an element that has already been selected;
<div class= "CSS" >
<p class= "Rain" > Test 1</p>
</div>
<div class= "Rain" >
<p> Test 2</p>
</div>
If we use the Find () method:
var $find = $ ("div"). Find (". Rain");
Alert ($find. HTML ());
will be output: Test 1
If you use the filter () method:
var $filter = $ ("div"). Filter (". Rain");
Alert ($filter. HTML ());
will be output: Test 2

The difference is:
Find () looks for the element with rain in the DIV element.
and filter () is the element that filters the div's class as rain.
One is a subset of its operations, and one is the filtering of its own collection elements.

Is (expr)//Determines whether an existing collection is part of or equal to the ' expr ' collection. Returns true if it is, otherwise returns false

Next (expr)//Gets a collection of the following sibling elements that contain each element in a matching set of elements.
Not (EL)/Match collection of elements that do not meet the filter requirements

Example:
$ ("div"). Not (". Green, #blueone")
$ ("Input:not (: Checked) + span")
$ (' Tr:not ([th]): Odd ')

Parent (expr) gets a collection of elements that contain the unique parent element of all matching elements
Parents (expr)//Gets the collection of all the ancestor elements of each element in the matching element collection
Prev (expr) Gets the first sibling collection of elements in the matching element collection
Siblings (expr) gets a collection of all sibling elements of each element in the set of matching elements

Core:
$ (HTML). Appendto ("Body") is equivalent to writing a piece of HTML code in the body
$ (Elems) get an element on the DOM
$ (function () {...}); Perform a function
$ ("div > P"). CSS ("Border", "1px solid Gray"); Find all Div's child node p, add style
$ ("Input:radio", Document.forms[0] finds all radio buttons in the first form of the current page
jquery has two methods for developing Plug-ins, respectively:
Jquery.extend (object) extends the jquery class itself. Adds a new method to the class.

Example
Jquery.extend ({
Min:function (A, b) {return a < b a:b;},
Max:function (A, b) {return a > b a:b;}
});
Referencing jquery:

Copy Code code as follows:

$.min (3,4); Return 3
JQuery.fn.extend (object) Adds a method to the jquery object, which extends the Jquery.prototype

Jquery.fn = Jquery.prototype = {
Init:function (Selector, context) {//....
//......
};


Example
Copy Code code as follows:

$.fn.extend ({
Alertwhileclick:function () {
$ (this). Click (function () {
Alert ($ (this). Val ());
});
}
});

Referencing jquery:
$ ("#input1"). Alertwhileclick ();

JQuery (expression, [context])---$ (expression, [context]); By default, the $ () query is the DOM element in the current HTML document.

Each (callback) performs a function as a context for each matching element

Example: 1

Copy Code code as follows:

$ ("span"). Click (function) {
$ ("Li"). each (function () {
$ (this). Toggleclass ("example");
});
});

Example: 2
Copy Code code as follows:

$ ("button"). Click (function () {
$ ("div"). each (function (index, domele) {
Domele = = This
$ (Domele). CSS ("BackgroundColor", "yellow");
if ($ (this). Is ("#stop")) {
$ ("span"). Text ("Stopped at Div Index #" + index);
return false;
}
});
});

JQuery Event: Events

Ready (FN); $ (document). Ready () Note that there is no onload event in the body, otherwise the function cannot be executed. There are many functions that can be loaded and executed in each page, in the order of FN.

Example:
$ (document). Ready (function () {alert ("AA");}

Bind (type, [data], FN) binds one or more event handler functions for each specific event (like click) for each matching element. Possible event type attributes are: Blur, focus, load, resize, scroll, unload, click, DblClick, MouseDown, MouseUp, Mousemove,mouseover, Mouseou T, MouseEnter, MouseLeave, change, select, Submit, KeyDown, Keypress,keyup, error

Example 1:
$ (' #myBtn '). Bind ("click", Function () {
Alert (' click ');
});

Example 2:
function Handler (event) {
alert (Event.data.foo);
}
$ ("P"). Bind ("click", {foo: "Bar"}, Handler)

One (type, [data], FN) binds a single or multiple event handler functions for each specific event (like click) for each matching element. On each object, this event handler is only executed once. The other rules are the same as the bind () function.
Type (String): Event type.
Data (object): (optional) An additional data object that is passed as the value of the Event.data property to the event object.
fn (function): The handler function above the event that is bound to each matching element.

Trigger (type, [data]) triggers a class of events on each matching element.
$ ("P"). Click (Function (event, a, b) {
An ordinary click event, A and B are undefined types
If triggered with the following statement, then a points to "Foo" and B points to "bar".
}). Trigger ("click", ["foo", "Bar"]); Toggle (FN, fn) if a matching element is clicked, the first specified function is triggered, and when the same element is clicked again, the specified second function is triggered.
$ ("P"). Toggle (function () {
$ (this). AddClass ("selected");
},
function () {
$ (this). Removeclass ("selected");
}
);

Example:
$ ("P"). Bind ("MyEvent", Function (event, Message1, Message2) {
Alert (message1 + ' + message2 ');
});
$ ("P"). Trigger ("MyEvent", ["Hello", "world!"]);
Triggerhandler (type, [data]) This particular method triggers a specific event on an element (specifying an event type) while canceling the browser's default action for this event
Unbind ([Type], [data]) is bound to remove the binding event from each matching element.
$ ("P"). Unbind () Remove all bound events on all paragraphs
$ ("P"). Unbind ("click") removes the Click event on all paragraphs

Example:

Copy Code code as follows:

var foo = function () {
Code to handle an event
};
$ ("P"). Bind ("click", foo); // ... When you click on a paragraph, it triggers the function foo
$ ("P"). Unbind ("click", foo); // ... Will never be triggered Foo

Hover (over, out) Over,out are methods that trigger the specified first function when the mouse is moved above a matching element. When the mouse moves out of this element, the specified second function is triggered.
$ ("P"). Hover (function () {
$ (this). addclass ("over");
},
function () {
$ (this). AddClass ("Out");
}
);


Element Event List Description
Note: A function with no parameters, whose argument is an optional FN. jquery does not support the reset event for form elements.
Event description, supporting elements or objects
Focus () Element gets focused a, input, textarea, button, select, label, map, area
Blur () element loses focus A, input, textarea, button, select, label, map, area
$ ("#in"). focus (function () {
if ($ ("#in"). val () = = ' keyword ') {
$ ("#in"). Val ("")};
}). blur (function () {
if ($ ("#in"). val () = = ') {
$ ("#in"). Val ("keywords"). CSS ("Color", "#ccc")};
});
Change () user changes the contents of the domain input, textarea, select
The change event is triggered when the element loses focus, and when its value is changed after the focus has been obtained.
$ ("input[type= ' text ']"). Change (function () {
Here you can write some validation code
});
Click () mouse clicks on almost all elements of an object
DblClick () mouse double-clicks almost all elements of an object
Error window occurs when loading a document or image, img
KeyDown () The key of a keyboard is pressed almost all elements
KeyPress () The key of a keyboard is pressed or pressed almost all elements
KeyUp () Key of a keyboard is loosened almost all elements
Load (FN) a page or image is finished loading window, img
MouseDown (FN) a mouse button is pressed for almost all elements
MouseMove (FN) mouse is moved almost all elements
Mouseout (FN) mouse removes almost all elements from an element
MouseOver (FN) mouse is moved to almost all elements on top of an element
MouseUp (FN) a mouse button is loosened almost all elements
Resize (FN) window or frame adjusted size window, IFRAME, frame
Scroll (FN) scrolls through the visual part of a document window
Select () text selected by document, input, textarea
Submit () button is clicked form
Unload (FN) User exits page window

JQuery Ajax Method Description:

Load (URL, [data], [callback]) loads a remote HTML content into a DOM node.
$ ("#feeds"). Load ("feeds.html"); Load the feeds.html file into a div with ID feeds
$ ("#feeds"). Load ("feeds.php", {limit:25}, function () {
Alert ("The last entries in the feed have been loaded");
});

Jquery.get (URL, [data], [callback]) uses get to request a page.
$.get ("test.cgi", {name: "John", Time: "2pm"}, function (data) {
Alert ("Data Loaded:" + data);
});

Jquery.getjson (URL, [data], [callback]) uses get to request JSON data.
$.getjson ("Test.js", {name: "John", Time: "2pm"}, function (JSON) {
Alert ("JSON Data:" + json.users[3].name);
});

Jquery.getscript (URL, [callback]) uses the GET request JavaScript file and executes it.
$.getscript ("Test.js", function () {
Alert ("Script loaded and executed.");
});
Jquery.post (URL, [data], [callback], [type]) uses post to request a page.

Ajaxcomplete (callback) when an AJAX request finishes, executes a function. This is an AJAX event
$ ("#msg"). Ajaxcomplete (function (request, settings) {
$ (this). Append ("<li>request complete.</li>");
});
Ajaxerror (callback) executes a function when an AJAX request fails. This is an AJAX event
$ ("#msg"). Ajaxerror (function (request, settings) {
$ (this). Append ("<li>error requesting page" + Settings.url + "</li>");
});
Ajaxsend (callback) executes a function when an AJAX request is sent. This is an AJAX event
$ ("#msg"). Ajaxsend (function (evt, request, settings) {
$ (this). Append ("<li<starting request at" + Settings.url
+ "</li<");
});

Ajaxstart (callback) executes a function when an AJAX request begins but has not yet been activated. This is an AJAX event
Display loading information when an AJAX request starts (and is not activated)
$ ("#loading"). Ajaxstart (function () {
$ (this). Show ();
});

Ajaxstop (callback) executes a function when all Ajax stops. This is an AJAX event
Hides loading information when all AJAX requests are stopped.
$ ("#loading"). Ajaxstop (function () {
$ (this). Hide ();
});

Ajaxsuccess (callback) when an AJAX request completes successfully, a function is executed. This is an AJAX event
When the AJAX request completes successfully, the information is displayed.
$ ("#msg"). Ajaxsuccess (function (evt, request, settings) {
$ (this). Append ("<li>successful request!</li>");
});

Jquery.ajaxsetup (options) makes global settings for all AJAX requests. View the $.ajax function to get all the option information.
Sets the default global AJAX request option.
$.ajaxsetup ({
URL: "/xmlhttp/",
Global:false,
Type: "POST"
});
$.ajax ({data:mydata});

Serialize () joins a set of input elements by name and value. The correct form element sequence is implemented
function ShowValues () {
var str = $ ("form"). Serialize ();
$ ("#results"). Text (str);
}
$ (": CheckBox,: Radio"). Click (showvalues);
$ ("select"). Change (ShowValues);
ShowValues ();

Serializearray () connects all forms and form elements (similar to the. Serialize () method), but returns a JSON data format.
Get a set of values from a form and show it
function ShowValues () {
var fields = $ (": Input"). Serializearray ();
alert (fields);
$ ("#results"). empty ();
Jquery.each (fields, function (i, field) {
$ ("#results"). Append (Field.value + "");
});
}
$ (": CheckBox,: Radio"). Click (showvalues);
$ ("select"). Change (ShowValues);
ShowValues ();

JQuery Effects Method Description

Show () shows hidden matching elements.
Show (speed, [callback]) displays all matching elements in an elegant animation and optionally triggers a callback function after the display is complete.
Hide () Hides all of the matching elements.
Hide (speed, [callback]) hides all matching elements with graceful animations and optionally triggers a callback function after the display is complete
Toggle () Toggles the visible state of the element. If the element is visible, switch to hidden, or if the element is hidden,
Switch to visible.
Slidedown (speed, [callback]) dynamically displays all matching elements by changing the height (downward), triggering a callback function optionally when the display is complete. This animation effect adjusts only the height of the element so that the matching element can be
"Slide" the way to show it.
Slideup (speed, [callback]) dynamically hides all matching elements by changing the height (up), optionally triggering a callback function after the shadowing is complete. This animation effect only adjusts the height of the elements, allowing the matching elements to be hidden in a "sliding" manner.
Slidetoggle (speed, [callback]) toggles the visibility of all matching elements by changing the height, and optionally triggers a callback function after the switch completes. This animation effect only adjusts the height of the elements, allowing the matching elements to be hidden or displayed in a "sliding" manner.
FadeIn (speed, [callback]) implements the fading effect of all matching elements through opacity changes, and optionally triggers a callback function after the animation completes. This animation only adjusts the opacity of the element, which means that the height and width of all matching elements do not change.
Fadeout (speed, [callback]) implements the fading effect of all matching elements through opacity changes and optionally triggers a callback function after the animation completes. This animation only adjusts the opacity of the element, which means that the height and width of all matching elements do not change.
Fadeto (speed, opacity, [callback]) adjusts the opacity of all matching elements incrementally to the specified opacity, and optionally triggers a callback function after the animation completes. This animation only adjusts the opacity of the element, which means that the height and width of all matching elements do not change.
Stop () stops the animation that all matching elements are currently running. If there are animations in the queue, they will start immediately.
Queue () Gets a reference to the animation sequence of the first matching element (returns an array of the contents as a function)
Queue (callback) adds an executable function to the end of the sequence of events for each matching element as an event function for this element
Queue (queue) replaces the original animation sequence of all matching elements with a new animation sequence
Dequeue () Executes and removes animation from the front of the animation sequence
Animate (params, [duration], [easing], [callback]) are the functions used to create custom animations.
Animate (params, options) is another way to create custom animations. function Ibid.


JQuery Traversing Method Description

EQ (index) Gets an element of a specified position from a matching set of elements, and index starts at 0
Filter (expr) returns a collection of elements that match the specified expression, and you can use the "," number to split multiple expr to implement multiple conditional filters.
Ilter (FN) uses a special function to remove elements that do not match in the collection as a filter condition.
Is (expr) examines the collection of currently selected elements with an expression, if at least one of the elements conforms to the given
An expression returns TRUE.
Map (callback) converts a set of elements in a jquery object to its value using the callback method and then adds it to a jquery array.
Not (expr) deletes an element that matches the specified expression from a matching set of elements.
Slice (start, [end]) obtains a subset from the set of matching elements, the same as the slice method of the built-in array.
Add (expr) adds an element that matches an expression to the jquery object.
Children ([expr]) gets a collection of elements that contain all the child elements of each element in a matching set of elements. An optional filter will make this method match only elements (element nodes, excluding text nodes).
Contents () Gets a collection of all descendants nodes that contain each element in a matching set of elements (including only element nodes, excluding text nodes), and if the element is an IFRAME, the document element is obtained
Find (expr) searches for all elements that match the specified expression.
Next ([expr]) gets a collection of elements that contain the next sibling element immediately following each element in the matching element collection.
Nextall ([expr]) gets a collection of elements that contain all of the following sibling elements for each element in a matching set of elements
Parent ([expr]) gets a collection of elements that contain the unique parent element of all matching elements.
Parents ([expr]) gets a collection of elements (without the root element) that contains the unique ancestor element of all matching elements.
Prev ([expr]) gets a collection of elements that contain the first sibling element immediately preceding each element in the matching element collection.
Prevall ([expr]) gets a collection of elements that contain all previous sibling elements of each element in a matching set of elements.
Siblings ([expr]) gets an element collection that contains all the sibling elements of each element in a matching set of elements.
Andself () adds the previously matched collection of elements to the current collection to get all the DIV elements and the p elements in them, adding the Border class attribute. Gets the P element in all DIV elements,
Add Background class Properties
$ ("div"). Find ("P"). Andself (). addclass ("border");
$ ("div"). Find ("P"). addclass ("background");
End () ends the current operation, returning to the previous action of the current operation
Finds the collection of span elements within all p elements, and then returns the collection of P elements, adding CSS Properties
$ ("P"). FIND ("span"). End (). CSS ("Border", "2px red Solid");

JQuery Selectors Selector Method description

Basic Selector
$ ("#myDiv") matches unique element with this ID value
$ ("div") matches all elements of the specified name
$ (". MyClass") matches all elements that have this class style value
$ ("*") matches all elements
$ ("Div,span,p.myclass") union of all matching selectors

Cascade Selector
$ ("form input") descendant selector, select all Descendants node of ancestor
$ ("#main > *") Child selector, select all child nodes of parent
$ ("label + input") Pro selector, select the next INPUT element node for all the label elements, and the test selector returns all input label elements immediately following the label label with an input label

$ ("#prev ~ div") sibling selector, which returns all the div tags that belong to the same parent element for a LABEL element with ID prev

Basic Filter Selector
$ ("Tr:first") matches the first selected element
$ ("Tr:last") matches the last selected element
$ ("Input:not (: Checked) + span") filters out all elements of the matching selector from the set of original elements (here is a pro selector)
$ ("Tr:even") matches all elements of an even position in the collection (starting from 0)
$ ("tr:odd") matches all elements of the odd position in the collection (starting from 0)
$ ("Td:eq (2)") matches the element at the specified position in the collection (starting from 0)
$ ("TD:GT (4)") matches all elements after the specified position in the collection (starting from 0)
$ ("TD:GL (4)") matches all elements before the specified position in the collection (starting from 0)
$ (": Header") matches all headings
$ ("div:animated") matches all elements that are running the animation

Content Filter Selector
$ ("Div:contains (' John ')") matches all elements that contain the specified text
$ ("Td:empty") matches all empty elements (elements that contain only text are not empty)
$ ("Div:has (P)") matches all elements that contain at least one selector from the original element collection again
$ ("td:parent") matches all elements that are not empty (including elements that contain text)
$ ("Div:hidden") matches all hidden elements, including hidden fields of the form
$ ("div:visible") matches all visible elements

Attribute Filter Selector
$ ("Div[id]") matches all elements with the specified property
$ ("input[name= ' newsletter ']") matches all elements with the specified property value
$ ("input[name!= ' newsletter ']") matches all elements that do not have the specified property value
$ ("input[name^= ' News ')" matches all elements with the specified property value starting with
$ ("input[name$= ' letter ']") matches all elements that specify the value of the property to end at value
$ ("input[name*= ' Man ')" matches all elements that have the specified property value containing a value character
$ ("input[id][name$= ' Man ')" matches all elements that meet multiple selectors at the same time

child element Filter Selector
$ ("UL Li:nth-child (2)"),
$ ("ul Li:nth-child (Odd)"), matching the nth child element of the parent element
$ ("ul Li:nth-child (3n + 1)")

$ ("div span:first-child") matches the 1th child element of the parent element
$ ("div span:last-child") matches the last 1 child elements of the parent element
$ ("div button:only-child") matches only 1 child elements of the parent element

Form element Selector
$ (": input") matches all form input elements, including all types of input, textarea, select and button
$ (": Text") matches all input elements of type text
$ (":p Assword") matches all input elements of type password
$ (": Radio") matches all input elements of type radio
$ (": checkbox") matches all input elements of type checkbox
$ (": Submit") matches all input elements of type submit
$ (": Image") matches all input elements of type image
$ (": Reset") matches all input elements of type reset
$ (": Button") matches all input elements of type button
$ (": File") matches all input elements of type file
$ (": hidden") matches the hidden fields of all input elements or forms that are of type hidden

Form Element Filter Selector
$ (": Enabled") matches all operable form elements
$ (":d isabled") matches all non-manipulated form elements
$ (": Checked") matches all selected elements
$ ("Select Option:selected") matches all selected elements

JQuery CSS Method Description

CSS (name) accesses the style properties of the first matching element.
CSS (properties) sets a "name/value pair" object to the style properties of all matching elements.
$ ("P"). Hover (function () {
$ (this). CSS ({backgroundcolor: "Yellow", FontWeight: "Bolder"});
}, function () {
var cssobj = {
BackgroundColor: "#ddd",
FontWeight: ",
Color:" RGB (0,40,244) "
}
$ (this). CSS ( Cssobj);
});
CSS (name, value) sets the value of a style property in all matching elements.
Offset () Gets the position of the first element that matches relative to the current visual window. The returned object has 2 properties,
Top and left, and the property value is an integer. This function can only be used for visible elements.
var p = $ ("P:last");
var offset = p.offset ();
P.html ("Left:" + Offset.left + ", Top:" + offset.top);
Width () Gets the width value of the element that is currently first matched,
width (val) Sets the specified width value for each matching element.
Height () Gets the height value of the element that is the first match,
Height (val) sets the specified height value for each matching element.

JQuery Utilities Method Description
Jquery.browser
. MSIE means IE
JQuery.browser.version read the version information of the user's browser
Jquery.boxmodel detects whether the user browser's display for the current page is based on the CSS box model of the Web
Jquery.isfunction (obj) detects whether the passed parameter is a function
function stub () {}
var OBJS = [
function () {},
{x:15, y:20},
Null
Stub
"Function"
];
Jquery.each (OBJS, function (i) {
var isfunc = jquery.isfunction (Objs[i]);
$ ("Span:eq (" + i + ")"). Text (Isfunc);
});
Jquery.trim (str) clears the spaces at each end of the string, using regular expressions to clear the spaces at both ends of the given character
Jquery.each (object, callback) a general-purpose iterator that can be used to seamlessly iterate over objects and arrays
Jquery.extend (Target, Object1, [objectn]) extends an object, modifies the original object, and returns, a powerful tool for implementing inheritance that is implemented using a value-transfer approach rather than a prototype chain in JavaScript.
Merge the settings and Options objects to return the modified Settings object
var settings = {validate:false, limit:5, Name: "foo"};
var options = {validate:true, name: "Bar"};
Jquery.extend (settings, options);

Merging defaults and Options objects, defaults objects are not modified. The value in the options object instead of the value of the defaults object is passed to the empty.

Copy Code code as follows:

var empty = {}
var defaults = {Validate:false, limit:5, Name: "foo"};
var options = {validate:true, name: "Bar"};
var settings = $.extend (empty, defaults, options);
Jquery.grep (Array, callback, [invert]) removes items from an array through a filter function
$.grep ([0,1,2], function (n,i) {
return n > 0;
});

Jquery.makearray (obj) converts an array-like object into a true array
Converts the collection of selected DIV elements into an array
var arr = Jquery.makearray (document.getElementsByTagName ("div"));
Arr.reverse (); Use a Array method on the list of DOM elements
$ (arr). Appendto (Document.body);
Jquery.map (Array, callback) modifies an item in an array by using a method, and then returns a new array
Jquery.inarray (value, array) returns the position of value in the array, or 1 if it is not found
Jquery.unique (array) deletes all repeating elements in the array, returning the sorted array

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.