I want to be able to click on any div from an array and have the box change it's opacity. I have a jsfiddle to explain better what I mean. I have the code working with plain javascript but I don't know how to do the same with jquery. Thanks for your help!
$('.mind:eq(i)').click(function () {
$('.mind:eq(i)').css('opacity', '1');
});
//Plain javascript
var box = document.getElementsByClassName('box');
function change(i2) {
box[i2].onclick = function () {
box[i2].style.opacity = "1";
};
}
for (i = 0; i < box.length; i++) {
change(i);
}
for loopor just have a general function that changes the opacity on click?