$(‘elems’).each() with fat arrow
The each() method supplies two parameters to the callback-function. They are current index and the current item. Thus you could do the following: $(‘ul#mylist > li’).each((i, v) => { $(v).addClass(‘some-class-name’); }); Where the “v” variable is the current “li” element