the inner text with the following code:
let val = event.target.parentNode.getElementsByTagName('p').textContent;
console.log(val);
but console.log return undefined. How to get the text "Buy bread"?
event.target will equal <li> element when I click it.
Обсуждают сегодня