document.onclick = function(e) { if ( e.target.classList.contains('item') ) console.log(e.target.innerText); };