i learned in the past to do this with jQuery but now i want to make it in pure vanilla js so this use to be my code with jQuery
$(".btn").click(function () {
var userChosenColor = $(this).attr("id");
});
and this is what i'm doing with pure js
var bTn = document.getElementsByClassName("btn");
for (var i = 0; i < bTn.length; i++) {
bTn[i].addEventListener("click", (e) => {
var userChosenColor = bTn[];
console.log(userChosenColor);
});
}