Selecting Elements | jQuery Learning Center
Sat May 29 2021 01:01:00 GMT+0000 (UTC)
Saved by @ejiwen
The best way to determine if there are any elements is to test the selection's .length property, which tells you how many elements were selected. If the answer is 0, the .length property will evaluate to false when used as a boolean value.
https://learn.jquery.com/using-jquery-core/selecting-elements/
Comments