Skip to content
Justice Tech School

each Loop

each runs a function on every match.

Example
$("li").each(function (i, el) {
  console.log(i, $(el).text());
});
$.each([1, 2], function (i, n) {
  console.log(n);
});

Exercise

Loop.

$("li").(function () {})

Quiz Test

What is this inside each?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.