var b = document.querySelector('body');
var arr = [1,4,2,43,54,30,6,3];
for (let tag of arr) {
var el = document.createElement('div');
el.appendChild(document.createTextNode('chto-to #'+tag));
b.appendChild(el);
el.addEventListener('click', function(e) {
someFunc(tag);
});
}
function someFunc(v) {
console.log(v);
}
setInterval(msg(1234,'1000', '2000'), 10000);