What are the three basic selectors in jQuery?

Updated on healthy 2024-03-11
9 answers
  1. Anonymous users2024-02-06

    1. Basic selector.

    The basic selector is the most commonly used and simplest selector in jQuery, which looks for DOM elements by their id, class, tag name, etc.

    1. ID selector.

    ID Description: Match an element according to the given ID and return a single element (Note: ID names cannot be duplicated in web pages).

    Example: $("#test"Select. id

    For. test

    element. 2. Class selector.

    class description: Returns a collection of elements that match elements based on the given class name.

    Example: $(".test")

    Select all elements whose class is test.

    3. Element selector.

    element

    Description: Returns a collection of elements by matching elements based on the given element name.

    Example: $("p")

    Select all elements.

    Description: Matches all elements, returns a collection of elements.

    Example: $("*")

    Select all elements.

    5、selector1,selector2,..Selectorn Description: Merge the elements matched by each selector and return them together, returning the merged element set.

    Example: $("p,span,")

    Select the set of elements with all and class tags as myclass.

    2. Hierarchy selector.

    3. Filter selector.

    Fourth, the form selector (returns the collection of elements, using similar).

  2. Anonymous users2024-02-05

    33. Introduction to jQuery + selector.

  3. Anonymous users2024-02-04

    33. Introduction to jQuery + selector.

  4. Anonymous users2024-02-03

    There is a difference between this.

    1. First of all, the two belong to two different languages, jquery is a framework that belongs to js, then its selector is a selector in js, css is another language different from js, and its selector is css selector, then the two are fundamentally different.

    2. But there is an intersection between the two, both are used as web pages or browser parsing languages, and JS can modify or control CSS by modifying the browser's DOM object.

    3. You can simply distinguish between the two in this way, CSS selector terms CSS, JS selectors are used in JS, but sometimes the two use the same ID identifier to select objects.

  5. Anonymous users2024-02-02

    In terms of the direction of searching, it seems that there is not much difference.

    But in essence, JQ is a library for JS, and CSS is two different languages, and the selectors in JQ are manipulating the DOM and CSS is defining styles

  6. Anonymous users2024-02-01

    css -- > jq.

    #idname-->"idname");

    classname-->".classname");

    These two are the most basic.

  7. Anonymous users2024-01-31

    Three talk about the banquet and the thirteenth, jquery Jane contains the key to introduce the smile + selector.

  8. Anonymous users2024-01-30

    There are a lot of jQuery selectors, probably more than 10.

  9. Anonymous users2024-01-29

    33. Introduction to jQuery + selector.

Related questions
10 answers2024-03-11

Let's take a JSON example;

1. What are the benefits of using json, for example, your ** uses text, and you need to split and other processing after returning; >>>More

24 answers2024-03-11

Recommended Card Master, Son of the Stars, Wild Huntress, Clockwork Spirit, Frost Witch. >>>More

12 answers2024-03-11

The first is the system-recommended free attack pattern.

It's easy to get started, but the disadvantage is also very big, that is, when you make up the knife, you will continue to lock the opponent's hero and automatically chase people, resulting in mistakes. And the most disgusting thing is that when there is still a trace of blood left in the tower of the locals, they attack the enemy hero by default, but the tower is not demolished, not to mention, and the other party will be killed under the tower, and a head will be given away in vain. When I was a newbie, I was unloaded several times by this pit. >>>More

11 answers2024-03-11

using systme;

using ; >>>More

6 answers2024-03-11

It's a big topic, let's talk about my own experience:

The optimization problem in mathematical modeling is a typical type of problem, the main feature is that the method to achieve a certain process or achieve a certain result is not unique, but the cost of different methods is different, and the optimization problem is to find the method with the least cost. So simply put, the purpose of an optimization problem is to find the best way to implement it. >>>More