Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to access event.target elements in typescript

document
  .querySelector('button')
  ?.addEventListener('click', event =>
    console.log((event.target as Element).textContent)
  );
 
PREVIOUS NEXT
Tagged: #access #elements #typescript
ADD COMMENT
Topic
Name
8+6 =