Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. $('.gallery img')[i].attr('id', 'img' + i);
  2.  
  3. $('.gallery img').each(function(i) {
  4. $(this).attr('id', 'img' + i);
  5. // You can also add more code here if you wish to manipulate each IMG element further
  6. });
  7.  
  8. $('.gallery img')[i]
  9.  
  10. $('.gallery img').eq(i).attr('id', 'img' + '"' + i + '"');
  11.  
  12. $('.gallery img').each(function(index, elem) {
  13. $(this).attr('id', 'img' + index);
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement