jquery - Loop through first 3 instances -


How can I loop through the first three instances of '.slide-item img' inside the document?

var set = []; $ ('.clide-item img'). Each (function () {var img = $ (this). Data ('src'); var id = $ (this) .Parent (). Attr ('id'); $ (this) .remove (); set .push ([img, id]);});

Lose all of the above, but I'm not sure how to limit it.

Limit your selection to start:

  $ ("Slide-item img: lt (3)"); Read more: 


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -