can somebody please help me? How to add auto increment number in div ID using javascript? I have four divs and I\'d like to have them automatically numbered (box1, box2, box
set id property
var list = document.getElementsByClassName("something"); for (var i = 0; i < list.length; i++) { list[i].id = "box" + (i + 1); }