I don't know if I am speaking correctly, because I am new to HTML. I have a ul menu with four boxes that are li's. I want a box to have a white border if I click that box.
This is my HTML code:
$("ul.quantity-grid li").click(function(){
$(this).addClass("active").siblings().removeClass("active");
});
.quantity-grid li.active{
border:4px solid #fff;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul class="quantity-grid">
<li class="1bag" data-value="1">
<h3>1 BAG, $35</h3>
<img src="img/1bag.png">
</li>
<li class="2bags" data-value="2">
<h3>2 BAGS, $45</h3>
<img src="img/2bags.png">
</li>
<li class="3bags" data-value="3">
<h3>3 BAGS, $65</h3>
<img src="img/3bags.png">
</li>
<li class="4bags" data-value="4">
<h3>4 BAGS, $55</h3>
<img src="img/4bags.png">
</li>
</ul>
What am I doing wrong?