Describes Jquerydata (), Jquerystop (), and jquerydelay () functions one by one (for details) _ jquery

Source: Internet
Author: User
This article describes the relevant information about Jquerydata (), Jquerystop (), and jquerydelay () functions one by one. For more information, see jquery data () functions.

In jQuery, the data () function is used to append data to the selected element or obtain data from the selected element. The data accessed through the data () function is temporary data. Once the page is refreshed, the previously stored data will no longer exist.

I. Functions of jquery data ()

The data () method attaches data to the selected element or obtains data from the selected element.
The data accessed through the data () function is temporary data. Once the page is refreshed, the previously stored data will no longer exist.
This function is a jQuery object (instance ). To remove data stored using the data () function, use the removeData () function.

Ii. Usage of jquery data

1. Get the value of the additional data

$ (Selector). data (name)

Parameter description

Name:

Optional. Specifies the name of the data to be retrieved.

If no name is specified, the method returns all stored data from the element as an object.

2. append data with name and value as the object

$ (Selector). data (name, value)

Parameter description

Selector: the object to be appended or to obtain data.
Name: the name of the data.
Value: the value of the data.

3. Use an object to attach data to an element

Use an object with a name/value pair to add data to the selected element.
In addition to assigning values by providing names and values, we can also directly pass in another object ("another") as a parameter. In this case, the attribute names and attribute values of "another" are considered as multiple key-value pairs, and the extracted "name" and "value" are copied to the cache of the target object.

$ (Selector). data (object)

Parameter description

Object: required. Specifies the object that contains the name/value pair.

Instance

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.