<li><a href="#" data-img="img/flag_english_active.png">English</a></li>
if(elem.tagName == 'A') { titleElem.innerHTML = elem.textContent; var url = elem.dataset.img; titleElem.style.backgroundImage = 'url('+url+')' }