Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does the jquery package set mean?

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this article "jquery Packaging set refers to what", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "jquery Packaging set refers to what" article.

In jquery, the wrapper set refers to a set of elements filtered out by the "$()" method; the wrapper set can be understood as an array of objects, the number of elements in the wrapper set can be checked by the size () method, and a certain element in the wrapper set can be obtained by the "get (index)" method.

The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.

What is the jquery package set

Using $("exp") will filter out a set of elements in the page, which are called wrapper sets.

The wrapper set is actually an array. You can use the size () method to check the number of elements in the wrapper set. You can use the get (index) method to get a certain element in the wrapper set and get a js element.

The jQuery wrapper set refers to a set of elements returned by the $() method, which is different from the normal javascript array, which also has some initialized functions and attributes. We can make a comparison between the two:

Jsdiv = document.getElementsByTagName ("div"); jqdiv = $("div"); / / javascript element set console.log (jsdiv); / / jquery package set console.log (jqdiv)

Debug with firebug to see the returned object:

As you can see, document.getElementsByTagName ("div") returns a set of HTMLCollection elements. $("div") returns an object that contains three div elements that we can access through the jqdiv [n] method. At the same time, the object also contains properties (such as length attributes) and methods (such as add (), append () methods) that are common to all wrappers.

The above is about the content of this article "what is the jquery package set". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report