Home >Web Front-end >JS Tutorial >jQuery class selector usage example_jquery

jQuery class selector usage example_jquery

WBOY
WBOYOriginal
2016-05-16 16:24:52931browse

The examples in this article describe the use of jQuery class selectors. Share it with everyone for your reference. The specific analysis is as follows:

The class selector matches all elements with the specified class name.

Example:

Copy code The code is as follows:
$(".mydiv")

The above code selects all elements with the class name mydiv.
Note: There is a dot (.) in front of mydiv.
Example code:

Copy code The code is as follows:






Script Home










The above code can hide the div element with the class name mydiv.

I hope this article will be helpful to everyone’s jQuery programming.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn