Finding Which Class[i] queue I Click

I wanna learn which classname[i] number I am clicking.. I wanna learn what is “i” when I click.. How can I get that data?

    function findclassquee(id) {
alert ("I am confused please help me about finding which one I am?; *<<<document.getElementsByClassName('trying')[1] or  *document.getElementsByClassName('trying')[5]>>> ");

    };
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button onclick="findclassquee(this.id)" class="trying">Which Class </button>
<button onclick="findclassquee(this.id)" class="trying">Which Class </button>
<button onclick="findclassquee(this.id)" class="trying">Which Class </button>
<button onclick="findclassquee(this.id)" class="trying">Which Class </button>
<button onclick="findclassquee(this.id)" class="trying">Which Class </button>
<button onclick="findclassquee(this.id)" class="trying">Which Class </button>

Answer

Youy can do it like this, with indexOf:

var elems = Array.from(document.querySelectorAll('.trying'));
// Listen for clicks on each element
elems.forEach(el => el.addEventListener('click', findclassquee));

function findclassquee() {
  // Find the index of the clicked one
  var index = elems.indexOf(this);
  alert(`You clicked on the element at index ${index}`);
}
<button class="trying">Which Class</button>
<button class="trying">Which Class</button>
<button class="trying">Which Class</button>
<button class="trying">Which Class</button>
<button class="trying">Which Class</button>
<button class="trying">Which Class</button>

Note: I’m using Array.from() to convert the NodeList to an Array, and be able to use Array methods on it, like indexOf.