Steven Hammons
Steven Hammons

Reputation: 1810

How to perform a " For " loop in jquery?

How to perform a " For " loop in jquery?

Upvotes: 0

Views: 309

Answers (3)

Bill Lynch
Bill Lynch

Reputation: 81926

jQuery.each(array, function() {
    console.log(this);
}

Upvotes: 1

Quintin Robinson
Quintin Robinson

Reputation: 82335

jQuery.each()

Or alternatively..

for(var i = 0; i < n; ++i) { /*TODO: Magic*/ }

Upvotes: 3

JasCav
JasCav

Reputation: 34632

Use the .each() function.

$('.someSelector').each(function() {
  // do stuff
});

Upvotes: 0

Related Questions