I want to color background of blocks with features__box
class but JS doesn't work/ Chrome doesn't recognize any error.
Here is HTML
<div class="features__active features__box">
<h3>Visual Composer</h3>
<p>TheFox comes with the Visual Composer Plugin. You won’t need to code or to remember any shortcodes with our. </p>
</div>
<div class="features__box">
<h3>Responsive</h3>
<p>TheFox comes with the Visual Composer Plugin. You won’t need to code or to remember any shortcodes with our. </p>
</div>
<div class="features__box">
<h3>Retina Ready</h3>
<p>TheFox comes with the Visual Composer Plugin. You won’t need to code or to remember any shortcodes with our. </p>
</div>
THis is JS :
var feature_i = document.querySelectorAll('.features__box');
feature_i.addEventListener('click', function(){
for( var i = 0; i < fearture_i.length; i++) {
feature_i[i].style.backgroundColor = "red";
}
});
By default the background of each item is white. I want it to toggle. Please, help!