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

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -