var list = document.getElementById('ulMenu').getElementsByTagName('LI'); for ( var i = 0; i < list.length; i++ ) { list[i].innerHTML = list[i].innerHTML.replace(/(\(.+?\))/, '<span>$1</span>'); }