JSFiddle - React, Tailwind, and code Playground

HTML

<div>
   <p>text 1</p>
   <p>text 2</p>
</div>

CSS

p {
  background: #ccc;
  padding: 5px;
}

JavaScript

let div = document.querySelector('div')

div.addEventListener('click', function(event){
	// how to get the clicked p tag here?
  alert(event.target.currentTarget)
})