Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.gallery img')[i].attr('id', 'img' + i);
- $('.gallery img').each(function(i) {
- $(this).attr('id', 'img' + i);
- // You can also add more code here if you wish to manipulate each IMG element further
- });
- $('.gallery img')[i]
- $('.gallery img').eq(i).attr('id', 'img' + '"' + i + '"');
- $('.gallery img').each(function(index, elem) {
- $(this).attr('id', 'img' + index);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement