Home › Forums › JavaScript › how can i access these classes › Reply To: how can i access these classes
December 12, 2016 at 2:57 am
#248903
Participant
Not sure what your question is but I’d like to offer a tip – you could use to built-in index instead of having all the counter variables:
$(".grid-item").each(function (index) {
'use strict';
$(this).attr("data-src", 'contents/photos/width4/4-' + index + '.JPG');
});