I am selecting some elements using jQuery and applying CSS like this...
$(".items div").not(".active").css({"color":"green","background":"red","z-index:":"-9"});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="items">
<div>Item 1</div>
<div class="active">Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
<div>Item 5</div>
</div>
The background
and the color
both work, but the z-index
is not being applied.
Where am I going wrong?