Just a simple question i cant seem to figure out. I have a simple function where i can click on the item[i].name and it opens up a description of the item. But i want it as when i click on the item[i].name or the item[i].cost, the description will open. But i can make only one of them work, i cant make it work with both.
Ive tried
if (item[i].name, item[i].cost == event.target.textContent) {
and a few other things but i cant seem to make it work with both. Is there a short way im just missing out on?
         el.addEventListener('click',function(event){
             $("#list").empty();
             console.log(event.target.textContent);
             for (var i = 0; i < item.length; i++) {
                     if (item[i].name == event.target.textContent) {
 
     
     
     
    