This article mainly summarizes and introduces the jQuery selector. If you need jQuery selector, you can refer to it and hope to help you with jQuery selector to make it easier and more flexible to obtain page elements, this greatly reduces the pressure on developers. Just like building a building, if there is no brick or tile, the building will not be able to be built and the elements will not be available. What are other operations? We can see the importance of the jQuery selector.
The general direction of the jquery selector is as follows:
Next, let's take a look at the general CSS selector of the basic selector:
1. Tag selector:
$ ("Element ")
The element parameter indicates the HTML Tag name to be searched, for example, $ ("p"). The tag selector can efficiently obtain elements because it inherits from getEmelentsByTagName in javascript, it obtains the set of the entire element.
2. ID Selector
$ ("Id ")
The parameter id indicates the id attribute value of the element to be searched. The digit "#" should be added before the parameter id, which is efficient in obtaining elements, because it inherits from getElementById ("") in JavaScript, id is unique in the page and complies with CSS standards.
ID Selector