How to know which sku is clicked on product page in bigcommerce?

Just one simple question, How to know which sku is clicked on frontend site via javascript so that I can fetch the clicked sku detail and process it further.

I’ve found below code from one of the app installed on the website. Which console the output of clicked SKU number. However, its very large code to debug and find a way to know this.

enter image description here

Also, below are the sku options which I want to know what is being clicked via JS to print on console.

enter image description here

Thanks in advance.