Can someone help me figure out how to assign unique IDs to 6 different Div elements as I step through them? The code snippet below is not working as expected, giving all Divs the same ID. What is the correct way to accomplish this task?
$('#main-slider div.et_pb_slide').first().attr('id','slide1');
$('#main-slider div.et_pb_slide').next().attr('id','slide2');
$('#main-slider div.et_pb_slide').next().attr('id','slide3');
$('#main-slider div.et_pb_slide').next().attr('id','slide4');
$('#main-slider div.et_pb_slide').next().attr('id','slide5');
$('#main-slider div.et_pb_slide').next().attr('id','slide6');