This article mainly introduces the usage of the empty selector in jQuery. The example analyzes the functions, definitions, and usage skills of the empty selector, which has some reference value, for more information about the empty selector usage in jQuery, see the following example. Share it with you for your reference. The specific analysis is as follows:
This selector matches all null elements that do not contain child elements or text.
Note:Space also belongs to the elements contained in the selector.
Syntax structure:
The Code is as follows:
$ (": Empty ")
This selector should also be used with other selectors, such as class selector and element selector. For example:
The Code is as follows:
$ ("Li: empty"). animate ({width: "200px "})
The preceding Code sets the width of the empty li element in the li element set to 200px in a Custom Animation.
Instance code:
Instance 1:
The Code is as follows:
Foot home