The difference between the jquery id selector and the class selector is often discussed.
Example:
<! DOCTYPE html>
The size () method returns the number of DOM objects.
<! DOCTYPE html>
That is:Id is unique. Even if multiple elements with the same id exist, the jquery selector can only obtain one of them. Therefore: to set the id action in jquery, the id can only appear once on the page.
For CSS Styles, you can select all DOM objects with id = box on the page:
#box { color: red;};
The Writing Method of the jQuery selector is very similar to that of the CSS selector, but the functions are different:
CSS adds a single style after finding an element, while jquery adds action behavior.
The difference between the jquery id selector and the class selector is the full content shared by the editor. I hope you can give us a reference and support the help house.