Summarize:child element selectors in pseudo-classes:The first type:: First-child: Last-child: Nth-child (): Nth-last-child ()The second type:: Only-child: Only-of-typeThe third type of:: First-of-type: Nth-last-of-type (): Nth-of-type ()Characteristics:Pseudo-class selectors are very characteristic:1. Position: Directly through the pseudo-class selector directly
This method is used to check whether the current element contains a particular class on top of the selector, and returns True if there is one.Instance: [jquery filter Hasclass (Class)] This method is used on the basis of the selector to check whether the current element cont
This article describes how jQuery uses the addClass () method to add multiple class styles to an element. The example shows how to use the addClass method and how to add multiple styles, for more information about how jQuery uses the addClass () method to add multiple class
This article describes how jQuery uses the addClass () method to add multiple class styles to an element. The example shows how to use the addClass method and how to add multiple styles, for more information about how jQuery uses the addClass () method to add multiple class
This article describes how jquery uses the remove () method to delete sub-elements of a specified class, which can be used to delete sub-elements of a specified class under a specified element, for more information about how jquery uses the remove () method to delete a speci
$ (": File")
All upload controls
$ (": input")
All form elements
$ (": Selected")
Selected items in all drop-down menus
$ (": visible")
All visible elements
$ (": Submit")
All Submit button
18, Reverse filter:$ ("tag: not (: a property)"): Selects any label that does not have a property.Filter out all tags that contain "one attribute" and leave other tags that do not have the attribute.For ex
1. Selector
In HTML, we can use web effects to select an HTML tag to operate, such as modifying the attributes of HTML tags, adding a class attribute, and so on. Using jquery to select an HTML tag is easier
1 Select an HTML tag through the ID attribute of the HTML
var id = jquery ("#id3");
Id.html ("hahaha");
The above code gets a div tag and assigns hahah
This article mainly introduces jquery using the Hide method to hide the specified element class style, and the example analyzes the Hide hidden class style in jquery, which has some reference value, and the friend who needs it can refer to
This example describes
The jquery support method is used to manipulate CSS properties of HTML elementsThe following method provides a CSS action method for jquery:
AddClass () – adds one or more CSS classes to the specified element.
Removeclass () – Deletes one or more CSS classes for the specified element.
Toggleclass () – Toggles betwee
Under the class= "Www111cnnet" There are 3 UL, now want to give each UL under the 5th Li element add class= "com"
Get the number of child elements under ID=DIV1
$ (' #div1 '). Children (). length;
Gets the number of span elements under ID=DIV1
$ (' #div1 '). Children (' span '). length;
Specific jquery code:
$ ("
In jquery, there are 2 ways to determine whether an element contains a deterministic class. The two methods have the same function. There are 2 ways to do this: (individuals prefer to use hasclass ())1. Hasclass (' classname ')2. Is ('. ClassName ')The following is an example of whether a DIV element contains a redcolo
In jquery, there are 2 ways to determine whether an element contains a deterministic class. The two methods have the same function. 2 methods are as follows:1. is ('. ClassName ')2. hasclass (' classname ')The following is an example of whether a DIV element contains a redcolor: 1. using the IS ('. ClassName ') met
Use jquery to determine whether an element contains a specified class instance, jqueryclass
In jquery, two methods can be used to determine whether an element contains a definite class ). The two methods have the same functions.
T
In jquery, there are 2 ways to determine whether an element contains a deterministic class. The two methods have the same function. 2 methods are as follows:
1. Is ('. ClassName ')
2. Hasclass (' classname ')
The following is an example of whether a DIV element contains a redcolor: 1. Using the IS ('. ClassName ') meth
, margin, padding, and transparency as it is visible to the hidden process.If you set this parameter, you cannot use the switch parameter.
Callback
Optional. The function to execute after the toggle function finishes executing.To learn more about callback, please visit our jQuery callback chapter. This parameter cannot be set unless the speed parameter is set.
Switch
Optional. Boolean value. Specifies whether to
How jquery sets sub-element class
There are 3 ul under class = "www111cnnet". Now we want to add class = "com" to the 5th li elements under each ul"
// Obtain the number of child elements under id = div1
$ ('# Div1'). children (). length;
// Obtain the number of span element
JQuery uses the removeClass method to delete the specified Class of an element.
This article mainly introduces how jQuery uses the removeClass method to delete a specified Class of an element. It can delete multiple elements in a
Background: Add and delete classes or attributes to HTML elements dynamically through jquery, so that HTML elements present different styles at different times, giving the user a better sense of experience.If the following P fragment and button buttons are present, the code is as follows:1 "pdisplay"> now the background color is white, click the button after the background changed to red 2 " ChangeColor "> Change Colors The following C
In jquery, there are 2 ways to determine whether an element contains a deterministic class. The two methods have the same function. 2 methods are as follows:1. Is ('. ClassName ')2. Hasclass (' classname ')The following is an example of whether a DIV element contains a redcolor:1. Using the IS ('. ClassName ') method$
JQuery uses the removeClass method to delete the Class specified by an element. jqueryremoveclass
This example describes how jQuery uses the removeClass method to delete the specified Class of an element. Share it with you for yo
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.