ExampleAlert the text of each li element:
Try it yourself » |
The each() method specifies a function to run for each matched element.
Tip: return false can be used to stop the loop early.
$(selector).each(function(index,element)) |
Parameter | Description |
---|---|
function(index,element) | Required. A function to run for each matched element.
|